Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OKD
building-user-defined-image
Commits
2d9b53eb
Commit
2d9b53eb
authored
Oct 26, 2020
by
Yori Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ci
parent
5f3f3f0c
Pipeline
#1901
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
0 deletions
+127
-0
.gitlab-ci.yml
.gitlab-ci.yml
+127
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
2d9b53eb
image
:
openshift/origin-cli
default
:
tags
:
-
okd
timeout
:
1h 00m
stages
:
-
build
# dummy stage to follow the template guidelines
-
test
-
deploy
# dummy stage to follow the template guidelines
-
review
-
staging
-
production
-
cleanup
variables
:
OPENSHIFT_SERVER
:
https://${OPENSHIFT_IP}:${OPENSHIFT_PORT}/
OPENSHIFT_DOMAIN
:
apps.okd.aip.de
# Configure this variable in Secure Variables:
#OPENSHIFT_TOKEN:
#OPENSHIFT_PROJECT: python
test1
:
stage
:
test
before_script
:
[]
script
:
-
echo run tests
test2
:
stage
:
test
before_script
:
[]
script
:
-
echo run tests
.deploy
:
&deploy
before_script
:
-
oc login "$OPENSHIFT_SERVER" --token="$OPENSHIFT_TOKEN" --insecure-skip-tls-verify
- oc project "$CI_PROJECT_NAME-$CI_PROJECT_ID" 2> /dev/null || oc new-project "$CI_PROJECT_NAME-$CI_PROJECT_ID"
script
:
-
"
oc
get
services
$APP
2>
/dev/null
||
oc
new-app
.
--name=$APP
--strategy=docker"
-
"
oc
start-build
$APP
--from-dir=.
--follow
||
sleep
3s
&&
oc
start-build
$APP
--from-dir=.
--follow"
-
"
oc
get
routes
$APP
2>
/dev/null
||
oc
create
route
edge
$APP
--service
$APP
--insecure-policy
Redirect"
review
:
<<
:
*deploy
stage
:
review
variables
:
APP
:
review-$CI_COMMIT_REF_NAME
APP_HOST
:
$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
environment
:
name
:
review/$CI_COMMIT_REF_NAME
url
:
https://$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
on_stop
:
stop-review
only
:
-
branches
except
:
-
master
stop-review
:
<<
:
*deploy
stage
:
cleanup
script
:
-
oc delete all -l "app=$APP"
when
:
manual
variables
:
APP
:
review-$CI_COMMIT_REF_NAME
GIT_STRATEGY
:
none
environment
:
name
:
review/$CI_COMMIT_REF_NAME
action
:
stop
only
:
-
branches
except
:
-
master
staging
:
<<
:
*deploy
stage
:
staging
variables
:
APP
:
staging
APP_HOST
:
$CI_PROJECT_NAME-staging.$OPENSHIFT_DOMAIN
environment
:
name
:
staging
url
:
https://$CI_PROJECT_NAME-staging.$OPENSHIFT_DOMAIN
only
:
-
master
production
:
<<
:
*deploy
stage
:
production
variables
:
APP
:
production
APP_HOST
:
$CI_PROJECT_NAME.$OPENSHIFT_DOMAIN
environment
:
name
:
production
url
:
https://$CI_PROJECT_NAME.$OPENSHIFT_DOMAIN
only
:
-
master
stop-project
:
<<
:
*deploy
stage
:
cleanup
script
:
-
oc delete all -l "app=$APP"
when
:
manual
variables
:
APP
:
production
environment
:
name
:
production
action
:
stop
only
:
-
master
stop-staging
:
<<
:
*deploy
stage
:
cleanup
script
:
-
oc delete all -l "app=$APP"
when
:
manual
variables
:
APP
:
staging
environment
:
name
:
staging
action
:
stop
only
:
-
master
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment