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 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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)",