diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5f4486cc2ee7c0296e89b72d0a2f13dccdcc40a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/atdb/logs/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14f5c66142e362730ce988714c5b390ab457d413..4775a40caed63c084e11ccdcae0910877e24005a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ stages: - build - deploy + - deploy_to_test + - deploy_to_production docker-build-master: # Official docker image. @@ -18,21 +20,21 @@ docker-build-master: - acceptance - release -#docker-build-branch: - # Official docker image. -# image: docker:latest -# stage: build -# services: -# - docker:dind -# before_script: -# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY -# script: -# - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" atdb -# - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -# except: -# - master -# - acceptance -# - release +docker-build-branch: +# Official docker image. + image: docker:latest + stage: build + services: + - docker:dind + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" atdb + - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + except: + - master + - acceptance + - release # deploy test/dev version on 'sdc-dev.astron.nl' docker-deploy-master: @@ -53,6 +55,7 @@ docker-deploy-master: only: - master + # deploy acceptance version on 'dop457.astron.nl' docker-deploy-acceptance: image: docker:latest @@ -89,5 +92,45 @@ docker-deploy-release: - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker pull "$CI_REGISTRY_IMAGE"" - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p atdb -f /opt/dockercompose/atdb-ldv-compose/docker-compose-production-cd.yml up -d" when: manual + only: + - release + + +# deploy master branch to 'sdc-dev.astron.nl' +docker-deploy-to-test: + image: docker:latest + stage: deploy-to-test + before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan dop814.astron.nl >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker pull "$CI_REGISTRY_IMAGE"" + - ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-dev-cd.yml up -d" + when: manual +# only: +# - master + +# deploy master branch to 'sdc.astron.nl' +docker-deploy-to-production: + image: docker:latest + stage: deploy-to-production + before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan dop821.astron.nl >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY" + - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker pull "$CI_REGISTRY_IMAGE"" + - ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p atdb -f /opt/dockercompose/atdb-ldv-compose/docker-compose-production-cd.yml up -d" + when: manual only: - release \ No newline at end of file diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index 55ba5dde0dbe3250425f0f89094702fa5129e0b0..1e74cca1929901ca440fc78d4d1969e4be730e9d 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -34,7 +34,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 1.0.0 (11 jul 2022 - 9:00) + <p class="footer"> Version 1.0.0 (20 oct 2022 - 10:00) </div>