Revert "Remove CI file from frame branch"
This reverts commit dac3632c28
This commit is contained in:
parent
9217628e0c
commit
c04ff1b891
1 changed files with 69 additions and 0 deletions
69
.gitlab-ci.yml
Normal file
69
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
|
||||
# Cache modules in between jobs
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- node_modules/
|
||||
|
||||
|
||||
# Electron app build
|
||||
build:
|
||||
stage: build
|
||||
image: nikolaik/python-nodejs:python3.7-nodejs14
|
||||
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
before_script:
|
||||
- git submodule sync --recursive
|
||||
- git submodule update --init --recursive
|
||||
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
|
||||
|
||||
script:
|
||||
- $HOME/.poetry/bin/poetry install
|
||||
- $HOME/.poetry/bin/poetry run build_static
|
||||
- $HOME/.poetry/bin/poetry run build
|
||||
|
||||
artifacts:
|
||||
name: "dist"
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "./dist/*"
|
||||
|
||||
only:
|
||||
- merge_requests
|
||||
- stable
|
||||
- master
|
||||
- web
|
||||
|
||||
|
||||
# Deploy to builds.openflexure.org
|
||||
deploy:
|
||||
stage: deploy
|
||||
dependencies:
|
||||
- build
|
||||
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_BATH_OPENFLEXURE_BASE64" | base64 --decode)
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
|
||||
script:
|
||||
# Install rsync if not already installed
|
||||
- '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/
|
||||
|
||||
# Run update-latest.py on the build server
|
||||
- ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py"
|
||||
|
||||
only:
|
||||
- stable
|
||||
Loading…
Add table
Add a link
Reference in a new issue