Skip to content
Snippets Groups Projects
Commit 985c60c9 authored by iaibrys's avatar iaibrys
Browse files

Merge branch 'develop' into feature/slupdate

* develop:
  Fix version name if it has a slash
  Update campus dumper script to pull latest container
  Pull latest enote in order to redeploy
  Pull latest enote in order to redeploy
  raise errors on failure
  Add log notes
  Put CI deployment into a script since it’s repeated everywhere.
  Create cache volume to save getpdf results between sessions.
  Update server name to production.
  Add CI/CD script which just syncs the source tree.
parents 1ff131c6 a701323d
No related branches found
No related tags found
No related merge requests found
Pipeline #405 failed
......@@ -2,3 +2,4 @@
*.out
/default.conf
phantomjs
.idea
......@@ -38,22 +38,12 @@ release-image:
- docker images | grep ${CI_PROJECT_PATH}
- docker push $CONTAINER_RELEASE_IMAGE
deploy_devel:
tags:
- deploy-devel
stage: deploy
script:
- echo "Deploy to ${CI_BUILD_REF_SLUG} server"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- cd /enote/src/dtu-enote
- ../../gen/docker-stop.sh
- git pull
- bundle exec rake deploy:all
- docker images | grep ${CI_PROJECT_PATH}
- docker ps -q -f status=exited | xargs -I '{}' docker rm -f '{}'
- docker ps -q -f status=dead | xargs -I '{}' docker rm -f '{}'
- docker image prune -f
- /enote/src/dtu-enote/scripts/redeploy.sh ${CI_BUILD_REF_SLUG} ${CI_JOB_TOKEN} ${CI_REGISTRY} ${CI_PROJECT_PATH}
environment:
name: develop
url: https://enote-devel3.compute.dtu.dk
......@@ -65,17 +55,7 @@ deploy_production:
- deploy-prod-2019
stage: deploy
script:
- echo "Deploy to ${CI_BUILD_REF_SLUG} server"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- cd /enote/src/dtu-enote
- ../../gen/docker-stop.sh
- git submodule update --init --recursive
- git pull
- bundle exec rake deploy:all
- docker images | grep ${CI_PROJECT_PATH}
- docker ps -q -f status=exited | xargs -I '{}' docker rm -f '{}'
- docker ps -q -f status=dead | xargs -I '{}' docker rm -f '{}'
- docker image prune -f
- /enote/src/dtu-enote/scripts/redeploy.sh ${CI_BUILD_REF_SLUG} ${CI_JOB_TOKEN} ${CI_REGISTRY} ${CI_PROJECT_PATH}
environment:
name: production
url: https://quiz.compute.dtu.dk
......
......@@ -56,7 +56,7 @@ module EnoteConfig
@timezone = "America/Los Angeles" if @timezone.blank?
@docker_registry = "lab.compute.dtu.dk:5005"
@docker_version_tag = %x{git symbolic-ref --short HEAD}.chomp
@docker_version_tag = %x{git symbolic-ref --short HEAD}.chomp.gsub('/', '-')
@test_config = YAML.load_file(File.join(config_root, 'test_config.yaml'))
......
......@@ -7,8 +7,11 @@ echo ---- RUNNING CAMPUS DUMPER ----
echo
date
echo BUILDING CNDUMPER
docker build ../dtu-enote-cndumper -t cndumper
version=$(git symbolic-ref --short HEAD | sed 's/\//-/g')
echo PULLING CNDUMPER
docker pull lab.compute.dtu.dk:5005/enote/dtu-enote-cndumper:${version}
docker tag lab.compute.dtu.dk:5005/enote/dtu-enote-cndumper:${version} cndumper
echo RUNNING CNDUMPER
/usr/bin/docker run --rm -v /enote/vol/cndumper:/dumps -v /enote/vol/config:/secrets:ro cndumper /cnd.rb
......
#!/bin/bash
# - cd /enote/src/dtu-enote/scripts/redeploy.sh ${CI_BUILD_REF_SLUG} ${CI_JOB_TOKEN} ${CI_REGISTRY} ${CI_PROJECT_PATH}
CI_BUILD_REF_SLUG=$1
CI_JOB_TOKEN=$2
CI_REGISTRY=$3
CI_PROJECT_PATH=$4
set -e
echo "Deploy to ${CI_BUILD_REF_SLUG} server"
docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
cd /enote/src/dtu-enote
echo "Stopping all containers"
../../gen/docker-stop.sh
echo "Pull latest enote"
git pull
git submodule update --recursive
echo "Deploy all"
bundle exec rake deploy:all
docker images | grep ${CI_PROJECT_PATH}
echo "Cleaning dead containers"
docker ps -q -f status=exited | xargs -I '{}' docker rm -f '{}'
docker ps -q -f status=dead | xargs -I '{}' docker rm -f '{}'
echo "Pruning images"
docker image prune -f
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment