Commit d2069a2f authored by Joren Vrancken's avatar Joren Vrancken

Move static coverage and docs sites to S3

parent 87ca321e
......@@ -65,51 +65,6 @@ python38-django22:
image: $PY38_IMAGE
allow_failure: true
.sshsetup: &sshsetup
before_script:
- mkdir -p ~/.ssh
- echo "$IVO_KNOWN_HOST" > ~/.ssh/known_hosts
- echo "$COVERAGE_DEPLOY_SSH_KEY" > ~/.ssh/id_coverage
- echo "$DOCS_DEPLOY_SSH_KEY" > ~/.ssh/id_docs
- chmod 0600 ~/.ssh/id_*
- apt-get update
- apt-get install -y openssh-client
coverage deploy:
stage: deploy
image: debian:stretch
dependencies:
- python37-django22
environment:
name: coverage/${CI_COMMIT_REF_NAME}
url: https://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/
on_stop: coverage remove
<<: *sshsetup
script:
- |
sftp -i ~/.ssh/id_coverage coveragewww@ivo.thalia.nu -b <<EOF
-rm ${CI_COMMIT_REF_SLUG}/*
-rmdir ${CI_COMMIT_REF_SLUG}
put -r website/covhtml ${CI_COMMIT_REF_SLUG}
EOF
coverage remove:
stage: deploy
when: manual
image: debian:stretch
environment:
name: coverage/${CI_COMMIT_REF_NAME}
action: stop
variables:
GIT_STRATEGY: none
<<: *sshsetup
script:
- |
sftp -i ~/.ssh/id_coverage coveragewww@ivo.thalia.nu -b <<EOF
rm ${CI_COMMIT_REF_SLUG}/*
rmdir ${CI_COMMIT_REF_SLUG}
EOF
docs tests:
stage: test
image: $PY37_IMAGE
......@@ -128,56 +83,6 @@ docs tests:
paths:
- docs/_build
docs deploy:
stage: deploy
image: debian:stretch
dependencies:
- docs tests
environment:
name: docs/${CI_COMMIT_REF_NAME}
url: https://docs.technicie.nl/${CI_COMMIT_REF_SLUG}/
on_stop: docs remove
<<: *sshsetup
script:
- |
sftp -i ~/.ssh/id_docs docswww@ivo.thalia.nu -b <<EOF
-rm ${CI_COMMIT_REF_SLUG}/*/*
-rm ${CI_COMMIT_REF_SLUG}/*
-rmdir ${CI_COMMIT_REF_SLUG}/_images
-rmdir ${CI_COMMIT_REF_SLUG}/_modules
-rmdir ${CI_COMMIT_REF_SLUG}/_sources
-rmdir ${CI_COMMIT_REF_SLUG}/_static
-rmdir ${CI_COMMIT_REF_SLUG}/doctest
-rmdir ${CI_COMMIT_REF_SLUG}/doctrees
-rmdir ${CI_COMMIT_REF_SLUG}
-mkdir ${CI_COMMIT_REF_SLUG}
put -r docs/_build/* ${CI_COMMIT_REF_SLUG}
EOF
docs remove:
stage: deploy
when: manual
image: debian:stretch
environment:
name: docs/${CI_COMMIT_REF_NAME}
action: stop
variables:
GIT_STRATEGY: none
<<: *sshsetup
script:
- |
sftp -i ~/.ssh/id_docs docswww@ivo.thalia.nu -b <<EOF
rm ${CI_COMMIT_REF_SLUG}/*/*
rm ${CI_COMMIT_REF_SLUG}/*
rmdir ${CI_COMMIT_REF_SLUG}/_images
rmdir ${CI_COMMIT_REF_SLUG}/_modules
rmdir ${CI_COMMIT_REF_SLUG}/_sources
rmdir ${CI_COMMIT_REF_SLUG}/_static
rmdir ${CI_COMMIT_REF_SLUG}/doctest
rmdir ${CI_COMMIT_REF_SLUG}/doctrees
rmdir ${CI_COMMIT_REF_SLUG}
EOF
build docker image:
stage: test
services:
......@@ -199,6 +104,32 @@ build docker image:
DOCKER_LATEST: registry.hub.docker.com/thalia/concrexit:latest
DOCKER_TAG: registry.hub.docker.com/thalia/concrexit:$CI_COMMIT_SHA
coverage deploy:
stage: "deploy"
image: "python:latest"
dependencies:
- "python37-django22"
environment:
name: "coverage/${CI_COMMIT_REF_NAME}"
url: "http://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/"
before_script:
- "pip install awscli"
script:
- "aws s3 cp --recursive --only-show-errors website/covhtml s3://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/"
docs deploy:
stage: "deploy"
image: "python:latest"
dependencies:
- "docs tests"
environment:
name: "documentation/${CI_COMMIT_REF_NAME}"
url: "http://docs.technicie.nl/${CI_COMMIT_REF_SLUG}/"
before_script:
- "pip install awscli"
script:
- "aws s3 cp --recursive --only-show-errors docs/_build s3://docs.technicie.nl/${CI_COMMIT_REF_SLUG}/"
.reviewsetup:
when: manual
image: python:latest
......@@ -293,7 +224,6 @@ review:
- aws --region eu-west-1 route53 wait resource-record-sets-changed --id ${changeinfoid}
- echo -e "The deployment is done. Please wait for the website to come up. You can login on https://${CI_COMMIT_REF_SLUG}.public.review.technicie.nl/ with:\nUsername:$username\nPassword:$password"
review remove:
stage: deploy
environment:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment