diff --git a/.gitignore b/.gitignore index 3f1d2a8e68a819c621bb2be951a4159ace5fdb30..2d76a9a3dfe8eb43503216c511348bc74911ad86 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *.pem .ipynb_checkpoints/ +scripts/surveys/.creds diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0f8e3602d100b9d08452b851f08cd12243758a19..7b7595095b2b54f5299a078957fb547d49401caa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,12 @@ stages: - lint - build + - deploy lint_frontend: stage: lint + except: + - feat/cd image: node script: - cd frontend @@ -12,6 +15,8 @@ lint_frontend: lint_backend: stage: lint + except: + - feat/cd image: registry.gitlab.com/pipeline-components/black:latest script: - black --check --verbose -- . @@ -31,3 +36,12 @@ build: script: - docker build -t $CI_REGISTRY/sbibauw/languagelab:$COMPONENT $COMPONENT - docker push $CI_REGISTRY/sbibauw/languagelab:$COMPONENT + +docker_deploy: + stage: deploy + only: + - main + - feat/cd + image: alpine:latest + script: + - echo "/mnt/data/languagelab/repo/scripts/update.sh" > /mnt/pipeline diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 0000000000000000000000000000000000000000..030cb9aa6e26ca70aec33e3f56c3391217f7c684 --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,7 @@ +echo "STARTED UPDATE AT $(date)" > /tmp/docker_update +cd /mnt/data/languagelab/repo/ +git pull +docker compose up -d +cd scripts/surveys +python3 survey_maker.py < .creds +echo "END UPDATE AT $(date)" >> /tmp/docker_update