From 3ac1ebdadd718b89c2ad3dc52c2e6ab5fbe6efda Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Thu, 12 Nov 2020 10:54:23 +0100 Subject: [PATCH] Always trigger a re-deploy to test-cara.web.cern.ch if we are on the live/test-cara branch. --- .gitlab-ci.yml | 6 +----- README.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4cb15e01..746ab680 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,11 +32,7 @@ trigger_build_on_openshift: deploy_to_test: stage: deploy rules: - - if: '$CI_MERGE_REQUEST_EVENT_TYPE == "detached"' - when: never - - if: '$OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET' - when: manual - allow_failure: true + - if: '$CI_COMMIT_BRANCH == "live/test-cara" && $OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET' script: - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-app/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-router/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic diff --git a/README.md b/README.md index cf5c0a7b..80882014 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,15 @@ The https://cern.ch/cara application is running on CERN's OpenShift platform. In * Created a Python 3.6 (the highest possible at the time of writing) application in OpenShift * Configured a generic webhook on OpenShift, and call that from the CI of the GitLab repository +### Updating the test-cara.web.cern.ch instance + +We have a replica of https://cara.web.cern.ch running on http://test-cara.web.cern.ch. Its purpose is to simulate what will happen when +a feature is merged. To push your changes to test-cara, simply push your branch to live/test-cara and the CI pipeline will trigger the +deployment. To push a to this branch, there is a good chance you will need to force push - you should always force push with care and +understanding why you are doing it. Syntactically, it will looks something like (assuming that you have "upstream" as your remote name, +but it may be origin if you haven't configured it differently): + + git push --force upstream name-of-local-branch:live/test-cara + +