Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
R
review-apps-openshift
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab-examples
review-apps-openshift
Commits
5306d55c
Commit
5306d55c
authored
8 years ago
by
Mark Pundsack
Browse files
Options
Downloads
Plain Diff
Merge branch 'ci-tweaks' into 'master'
Update `.gitlab-ci.yml` See merge request !2
parents
ab3efe51
29a8c3b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+24
-23
24 additions, 23 deletions
.gitlab-ci.yml
with
24 additions
and
23 deletions
.gitlab-ci.yml
+
24
−
23
View file @
5306d55c
...
...
@@ -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
:
r
aoc
-$CI_BUILD_REF_NAME
APP
:
r
eview
-$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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment