Commit 1b3e25be authored by Joel Collins's avatar Joel Collins
Browse files

Updated CI to build dist archive

parent fb51930c
Loading
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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"