Updated CI to build dist archive

This commit is contained in:
Joel Collins 2020-05-16 21:29:40 +01:00
parent fb51930cc4
commit 1b3e25be9b

View file

@ -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"