From 1b3e25be9beb7b81d2f333bd029366738e304ca1 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sat, 16 May 2020 21:29:40 +0100 Subject: [PATCH] Updated CI to build dist archive --- .gitlab-ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 714667bc..bd947a73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,10 +24,13 @@ build: - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python script: + # Install server - $HOME/.poetry/bin/poetry install + # Run static build script - $HOME/.poetry/bin/poetry run build_static - - $HOME/.poetry/bin/poetry build - - $HOME/.poetry/bin/poetry export --without-hashes -f requirements.txt > dist/requirements.txt + # Build distribution archive + - mkdir -p dist + - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz . artifacts: name: "dist" @@ -60,7 +63,7 @@ deploy: - 'which rsync || ( apt-get update -y && apt-get install rsync -y )' # Upload the builds folder to openflexure-microscope builds - - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server/${CI_COMMIT_REF_NAME} --delete + - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server # Run update-latest.py on the build server - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py"