From 6a172911bd73c2bddf34acd30cb736953d26bc04 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 8 Aug 2019 11:19:32 +0100 Subject: [PATCH 01/13] Updated electron-builder --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d43df844..e61d6d4c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "axios": "^0.18.0", "css-loader": "^2.1.1", "electron": "^4.1.4", - "electron-builder": "^21.0.1", + "electron-builder": "^21.2.0", "less": "^3.9.0", "less-loader": "^4.1.0", "uikit": "^3.1.1", From 0f4db3f5d4bec0c1787c86e0c80fef2d30a7604f Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 19 Aug 2019 10:06:05 +0100 Subject: [PATCH 02/13] Only draw CET by default on Windows --- app/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store.js b/app/store.js index bd1a8b95..549a45f7 100644 --- a/app/store.js +++ b/app/store.js @@ -3,7 +3,7 @@ const store = new Store(); if (store.has('drawCustomTitleBar') !== true) { // Default to false if on MacOS, otherwise true - store.set('drawCustomTitleBar', (process.platform !== 'darwin') ? true : false) + store.set('drawCustomTitleBar', (process.platform === 'win32') ? true : false) } module.exports.store = store \ No newline at end of file From 2dbf59310223f21827d5aed2352c5d013ddf9a4f Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:06:21 +0000 Subject: [PATCH 03/13] Update to test SSH deployment --- .gitlab-ci.yml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91d7e4bb..a6d4157f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,23 +8,6 @@ cache: paths: - node_modules/ -# Basic webapp build -build: - stage: build - image: electronuserland/builder:wine - script: - - npm install - - npm run build:web - artifacts: - name: "build" - paths: - - dist/ - only: - - stable - - tags - - web - - # Electron app build package: stage: build @@ -41,6 +24,7 @@ package: - mv ./release-builds/?(beta*.yml|latest*.yml) . artifacts: name: "dist" + expire_in: 1 day paths: - "*.AppImage" - "*.deb" @@ -49,8 +33,19 @@ package: - "latest*.yml" - "beta*.yml" only: - - stable - tags + +deploy: + image: ubuntu:latest + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY_BASE64" | base64 --decode) + - mkdir -p ~/.ssh + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + script: + - ssh -t ci-user@openflexure.bath.ac.uk "touch test.txt" + only: - web # Create a nupkg file for Choco package manager From 513a4045446da4d66546bab6866d7d3ec6f8ac4c Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:06:54 +0000 Subject: [PATCH 04/13] Update deploy stage --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6d4157f..1e1e3d03 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - meta + - deploy # Cache modules in between jobs cache: @@ -36,6 +37,7 @@ package: - tags deploy: + stage: deploy image: ubuntu:latest before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' From 116fb5c7314371fecbb6d51e8fb949d70f1152fa Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:11:50 +0000 Subject: [PATCH 05/13] Add version to artifact names --- app/builder-config-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/builder-config-base.yaml b/app/builder-config-base.yaml index d62cf387..f7055443 100644 --- a/app/builder-config-base.yaml +++ b/app/builder-config-base.yaml @@ -2,7 +2,7 @@ directories: output: release-builds buildResources: app/resources appId: org.openflexure.ev -artifactName: ${name}-${os}-${arch}.${ext} +artifactName: ${name}-${version}-${os}-${arch}.${ext} asar: true publish: - provider: generic From bff6a570d58511b207b50e0a818fd9432573f8f6 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:26:34 +0000 Subject: [PATCH 06/13] Attempt rsync test --- .gitlab-ci.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e1e3d03..48bf9267 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,22 +17,15 @@ package: - npm install - npm run build:app - npm run release - - shopt -s extglob - - mv ./release-builds/*.AppImage . - - mv ./release-builds/*.deb . - - mv ./release-builds/*.exe . - - mv ./release-builds/*.exe.blockmap . - - mv ./release-builds/?(beta*.yml|latest*.yml) . artifacts: name: "dist" - expire_in: 1 day + expire_in: 1 hour paths: - - "*.AppImage" - - "*.deb" - - "*.exe" - - "*.exe.blockmap" - - "latest*.yml" - - "beta*.yml" + - "./release-builds/*.AppImage" + - "./release-builds/*.exe" + - "./release-builds/*.exe.blockmap" + - "./release-builds/latest*.yml" + - "./release-builds/beta*.yml" only: - tags @@ -46,7 +39,9 @@ deploy: - mkdir -p ~/.ssh - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config script: - - ssh -t ci-user@openflexure.bath.ac.uk "touch test.txt" + - mkdir -p "./release-builds" + - touch "./release-builds/build-placeholder.txt" + - rsync -hrvz -e ssh release-builds/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-ev/ only: - web From a9bde40964d513aaf55ff26391846e36306d9c01 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:30:10 +0000 Subject: [PATCH 07/13] Install rsync into deploy stage --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48bf9267..a33f2654 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,6 +39,7 @@ deploy: - mkdir -p ~/.ssh - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config script: + - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' - mkdir -p "./release-builds" - touch "./release-builds/build-placeholder.txt" - rsync -hrvz -e ssh release-builds/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-ev/ From 047d4be57057746dab0b810696d18007c2b5627e Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 10:38:35 +0000 Subject: [PATCH 08/13] Test using actual release-builds --- .gitlab-ci.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a33f2654..c7e6eddf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,5 @@ stages: - build - - meta - deploy # Cache modules in between jobs @@ -10,7 +9,7 @@ cache: - node_modules/ # Electron app build -package: +build: stage: build image: electronuserland/builder:wine script: @@ -27,10 +26,13 @@ package: - "./release-builds/latest*.yml" - "./release-builds/beta*.yml" only: + - web - tags deploy: stage: deploy + dependencies: + - build image: ubuntu:latest before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' @@ -41,31 +43,7 @@ deploy: script: - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' - mkdir -p "./release-builds" - - touch "./release-builds/build-placeholder.txt" - rsync -hrvz -e ssh release-builds/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-ev/ only: - web -# Create a nupkg file for Choco package manager -meta:choco: - stage: meta - dependencies: - - package - image: patrickhuber/choco-linux - script: - - chmod +x ./app/make-nupkg.sh - - ./app/make-nupkg.sh - - cd ./release-builds/choco - - choco pack - - cd ../../ - - mv ./release-builds/choco/openflexure-ev.nuspec . - - mv ./release-builds/choco/*.nupkg . - - mv ./release-builds/choco/tools . - artifacts: - name: "openflexure-ev-choco-nupkg" - paths: - - ./openflexure-ev.nuspec - - tools/chocolateyInstall.ps1 - - ./*.nupkg - only: - - tags From f3a1b839b95f2667e9f09ae694ac02187fb2dddc Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 11:08:55 +0000 Subject: [PATCH 09/13] Remove setFeedURL --- app/app.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/app.js b/app/app.js index 34c5c85a..e9b56f12 100644 --- a/app/app.js +++ b/app/app.js @@ -12,11 +12,6 @@ const { store } = require('./store') // Auto upadater autoUpdater.autoDownload = false; -autoUpdater.setFeedURL({ - provider: "generic", - url: "https://gitlab.com/openflexure/openflexure-microscope-jsclient/-/jobs/artifacts/stable/raw?job=package" -}); - autoUpdater.on('checking-for-update', function () {}); autoUpdater.on('update-available', function (info) { From 7b8eec8f4bc5b3b840a78ea3190ecc8135dbad75 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 11:09:22 +0000 Subject: [PATCH 10/13] Update publish URL --- app/builder-config-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/builder-config-base.yaml b/app/builder-config-base.yaml index f7055443..1a1e9fe8 100644 --- a/app/builder-config-base.yaml +++ b/app/builder-config-base.yaml @@ -6,7 +6,7 @@ artifactName: ${name}-${version}-${os}-${arch}.${ext} asar: true publish: - provider: generic - url: https://gitlab.com + url: https://build.openflexure.org/openflexure-ev/ files: - filter: - '**/*' From 59fc68467f90e144a5798aed6461ea67c2b60311 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 12:22:58 +0000 Subject: [PATCH 11/13] Iterate version to test auto-update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e61d6d4c..0baf0fa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openflexure-ev", - "version": "1.1.1", + "version": "1.1.2", "private": true, "description": "An electron-based user client for the OpenFlexure Microscope Server", "author": "OpenFlexure (https://www.openflexure.org)", From 5f0852a4ab7f9205b15e7babe48e948c3ddbf14a Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 13:02:59 +0000 Subject: [PATCH 12/13] Revert .gitlab-ci.yml --- .gitlab-ci.yml | 81 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7e6eddf..91d7e4bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ stages: - build - - deploy + - meta # Cache modules in between jobs cache: @@ -8,42 +8,71 @@ cache: paths: - node_modules/ -# Electron app build +# Basic webapp build build: + stage: build + image: electronuserland/builder:wine + script: + - npm install + - npm run build:web + artifacts: + name: "build" + paths: + - dist/ + only: + - stable + - tags + - web + + +# Electron app build +package: stage: build image: electronuserland/builder:wine script: - npm install - npm run build:app - npm run release + - shopt -s extglob + - mv ./release-builds/*.AppImage . + - mv ./release-builds/*.deb . + - mv ./release-builds/*.exe . + - mv ./release-builds/*.exe.blockmap . + - mv ./release-builds/?(beta*.yml|latest*.yml) . artifacts: name: "dist" - expire_in: 1 hour paths: - - "./release-builds/*.AppImage" - - "./release-builds/*.exe" - - "./release-builds/*.exe.blockmap" - - "./release-builds/latest*.yml" - - "./release-builds/beta*.yml" + - "*.AppImage" + - "*.deb" + - "*.exe" + - "*.exe.blockmap" + - "latest*.yml" + - "beta*.yml" only: - - web + - stable - tags - -deploy: - stage: deploy - dependencies: - - build - image: ubuntu:latest - before_script: - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY_BASE64" | base64 --decode) - - mkdir -p ~/.ssh - - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - script: - - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' - - mkdir -p "./release-builds" - - rsync -hrvz -e ssh release-builds/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-ev/ - only: - web +# Create a nupkg file for Choco package manager +meta:choco: + stage: meta + dependencies: + - package + image: patrickhuber/choco-linux + script: + - chmod +x ./app/make-nupkg.sh + - ./app/make-nupkg.sh + - cd ./release-builds/choco + - choco pack + - cd ../../ + - mv ./release-builds/choco/openflexure-ev.nuspec . + - mv ./release-builds/choco/*.nupkg . + - mv ./release-builds/choco/tools . + artifacts: + name: "openflexure-ev-choco-nupkg" + paths: + - ./openflexure-ev.nuspec + - tools/chocolateyInstall.ps1 + - ./*.nupkg + only: + - tags From f9c205c75fc1a0e364c2f6fa92ad3c97c9f38fd7 Mon Sep 17 00:00:00 2001 From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com> Date: Wed, 21 Aug 2019 13:20:07 +0000 Subject: [PATCH 13/13] Revert "Add version to artifact names" This reverts commit 116fb5c7314371fecbb6d51e8fb949d70f1152fa --- app/builder-config-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/builder-config-base.yaml b/app/builder-config-base.yaml index 1a1e9fe8..a226f09b 100644 --- a/app/builder-config-base.yaml +++ b/app/builder-config-base.yaml @@ -2,7 +2,7 @@ directories: output: release-builds buildResources: app/resources appId: org.openflexure.ev -artifactName: ${name}-${version}-${os}-${arch}.${ext} +artifactName: ${name}-${os}-${arch}.${ext} asar: true publish: - provider: generic