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"