Always trigger a re-deploy to test-cara.web.cern.ch if we are on the live/test-cara branch.

This commit is contained in:
Phil Elson 2020-11-12 10:54:23 +01:00
parent c303c9d349
commit 3ac1ebdadd
2 changed files with 12 additions and 5 deletions

View file

@ -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

View file

@ -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