Commit 5306d55c authored by Mark Pundsack's avatar Mark Pundsack
Browse files

Merge branch 'ci-tweaks' into 'master'

Update `.gitlab-ci.yml`

See merge request !2
parents ab3efe51 29a8c3b9
......@@ -6,6 +6,7 @@ stages:
- review
- staging
- production
- cleanup
variables:
# Configure these variables in Secure Variables:
......@@ -32,17 +33,17 @@ test2:
image: ayufan/openshift-cli
before_script:
- oc login "$OPENSHIFT_SERVER" --token="$OPENSHIFT_TOKEN" --insecure-skip-tls-verify
- oc project "$CI_PROJECT_NAME"
- oc project "$CI_PROJECT_NAME" 2> /dev/null || oc new-project "$CI_PROJECT_NAME"
script:
- oc get services $APP || oc new-app . --name=$APP --strategy=docker
- oc get routes $APP || oc expose service $APP --hostname=$APP_HOST
- oc get services $APP 2> /dev/null || oc new-app . --name=$APP --strategy=docker
- oc get routes $APP 2> /dev/null || oc expose service $APP --hostname=$APP_HOST
- oc start-build $APP --from-dir=. --wait
review:
<<: *deploy
stage: review
variables:
APP: raoc-$CI_BUILD_REF_NAME
APP: review-$CI_BUILD_REF_NAME
APP_HOST: $CI_PROJECT_NAME-$CI_BUILD_REF_NAME.review.$OPENSHIFT_DOMAIN
environment:
name: review/$CI_BUILD_REF_NAME
......@@ -53,28 +54,11 @@ review:
except:
- master
stop-review:
<<: *deploy
stage: review
script:
- oc delete all -l "app=$APP"
when: manual
variables:
APP: raoc-$CI_BUILD_REF_NAME
GIT_STRATEGY: none
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- branches
except:
- master
staging:
<<: *deploy
stage: staging
variables:
APP: raoc-staging
APP: staging
APP_HOST: $CI_PROJECT_NAME-staging.$OPENSHIFT_DOMAIN
environment:
name: staging
......@@ -86,7 +70,7 @@ production:
<<: *deploy
stage: production
variables:
APP: roac-production
APP: production
APP_HOST: $CI_PROJECT_NAME.$OPENSHIFT_DOMAIN
when: manual
environment:
......@@ -94,3 +78,20 @@ production:
url: http://$CI_PROJECT_NAME.$OPENSHIFT_DOMAIN
only:
- master
stop-review:
<<: *deploy
stage: cleanup
script:
- oc delete all -l "app=$APP"
when: manual
variables:
APP: $CI_BUILD_REF_NAME
GIT_STRATEGY: none
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- branches
except:
- master
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