Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cern-search-rest-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
webservices
cern-search
cern-search-rest-api
Commits
2ee097ab
Commit
2ee097ab
authored
5 years ago
by
Carina Antunes
Browse files
Options
Downloads
Patches
Plain Diff
Add dev CI
parent
5d15e256
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
+91
-4
91 additions, 4 deletions
.gitlab-ci.yml
with
91 additions
and
4 deletions
.gitlab-ci.yml
+
91
−
4
View file @
2ee097ab
...
@@ -9,7 +9,9 @@ variables:
...
@@ -9,7 +9,9 @@ variables:
RESOURCE
:
cern-search-rest-api
RESOURCE
:
cern-search-rest-api
### OpenShift namespace and server values
### OpenShift namespace and server values
NAMESPACE
:
cern-search-master
NAMESPACE
:
cern-search-master
NAMESPACE_DEV
:
test-cern-search-master
OPENSHIFT_SERVER
:
https://openshift.cern.ch
OPENSHIFT_SERVER
:
https://openshift.cern.ch
OPENSHIFT_SERVER_DEV
:
https://openshift-dev.cern.ch
### By default, there are 6 stages that we may use:
### By default, there are 6 stages that we may use:
### Feel free to adapt this to your specific case.
### Feel free to adapt this to your specific case.
...
@@ -147,8 +149,8 @@ build_test_version_manual:
...
@@ -147,8 +149,8 @@ build_test_version_manual:
BUILD_ARG
:
build_env=dev
BUILD_ARG
:
build_env=dev
TO
:
${CI_REGISTRY_IMAGE}:$CI_COMMIT_REF_SLUG
TO
:
${CI_REGISTRY_IMAGE}:$CI_COMMIT_REF_SLUG
#
If a new tag is pushed it needs to be referenced into the ImageStream
#
## Create tag in OpenShift.
tag_image_
test
:
tag_image_
merge_request_prod
:
extends
:
.tag_image
extends
:
.tag_image
only
:
only
:
refs
:
refs
:
...
@@ -161,8 +163,24 @@ tag_image_test:
...
@@ -161,8 +163,24 @@ tag_image_test:
TAG
:
$CI_COMMIT_REF_SLUG
TAG
:
$CI_COMMIT_REF_SLUG
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
### Create tag in OpenShift DEV.
tag_image_merge_request_dev
:
extends
:
.tag_image
only
:
refs
:
-
merge_requests
environment
:
name
:
branch/$CI_COMMIT_REF_SLUG
when
:
manual
variables
:
CI_REGISTRY_TAG
:
$CI_COMMIT_REF_SLUG
TAG
:
$CI_COMMIT_REF_SLUG
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
# Import image into OpenShift.
# Import image into OpenShift.
import_image_
test
:
import_image_
merge_request_prod
:
extends
:
.import_image
extends
:
.import_image
only
:
only
:
refs
:
refs
:
...
@@ -174,6 +192,21 @@ import_image_test:
...
@@ -174,6 +192,21 @@ import_image_test:
TAG
:
$CI_COMMIT_REF_SLUG
TAG
:
$CI_COMMIT_REF_SLUG
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
# Import image into OpenShift DEV.
import_image_merge_request_dev
:
extends
:
.import_image
only
:
refs
:
-
merge_requests
environment
:
name
:
branch/$CI_COMMIT_REF_SLUG
when
:
manual
variables
:
TAG
:
$CI_COMMIT_REF_SLUG
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
######################################################
######################################################
##################### Dev branch #####################
##################### Dev branch #####################
build_dev_version
:
build_dev_version
:
...
@@ -184,7 +217,7 @@ build_dev_version:
...
@@ -184,7 +217,7 @@ build_dev_version:
BUILD_ARG
:
build_env=dev
BUILD_ARG
:
build_env=dev
### Import image into OpenShift.
### Import image into OpenShift.
import_image_dev_
test
:
import_image_dev_
branch_prod
:
extends
:
.import_image
extends
:
.import_image
only
:
only
:
-
dev
-
dev
...
@@ -194,6 +227,18 @@ import_image_dev_test:
...
@@ -194,6 +227,18 @@ import_image_dev_test:
TAG
:
latest
TAG
:
latest
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
### Import image into OpenShift DEV
import_image_dev_branch_dev
:
extends
:
.import_image
only
:
-
dev
environment
:
name
:
staging
variables
:
TAG
:
latest
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
######################################################
######################################################
####################### Tags ########################
####################### Tags ########################
...
@@ -204,6 +249,7 @@ build_tagged_version:
...
@@ -204,6 +249,7 @@ build_tagged_version:
variables
:
variables
:
TO
:
${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
TO
:
${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
### Create tag in OpenShift.
tag_image_prod
:
tag_image_prod
:
extends
:
.tag_image
extends
:
.tag_image
environment
:
environment
:
...
@@ -213,6 +259,19 @@ tag_image_prod:
...
@@ -213,6 +259,19 @@ tag_image_prod:
TAG
:
${CI_COMMIT_TAG}
TAG
:
${CI_COMMIT_TAG}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
### Create tag in OpenShift DEV.
tag_image_dev
:
extends
:
.tag_image
environment
:
name
:
production
variables
:
CI_REGISTRY_TAG
:
${CI_COMMIT_TAG}
TAG
:
${CI_COMMIT_TAG}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
### Import image into OpenShift.
import_tagged_image_prod
:
import_tagged_image_prod
:
extends
:
.import_image
extends
:
.import_image
environment
:
environment
:
...
@@ -223,6 +282,20 @@ import_tagged_image_prod:
...
@@ -223,6 +282,20 @@ import_tagged_image_prod:
TAG
:
${CI_COMMIT_TAG}
TAG
:
${CI_COMMIT_TAG}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
### Import image into OpenShift DEV.
import_tagged_image_dev
:
extends
:
.import_image
environment
:
name
:
production
only
:
-
tags
variables
:
TAG
:
${CI_COMMIT_TAG}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
### Deploy stable into OpenShift.
deploy_production
:
deploy_production
:
extends
:
.tag_image
extends
:
.tag_image
stage
:
deploy
stage
:
deploy
...
@@ -233,3 +306,17 @@ deploy_production:
...
@@ -233,3 +306,17 @@ deploy_production:
CI_REGISTRY_TAG
:
${CI_COMMIT_TAG}
CI_REGISTRY_TAG
:
${CI_COMMIT_TAG}
TAG
:
stable
TAG
:
stable
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_PROD}
### Deploy stable into OpenShift DEV.
deploy_dev
:
extends
:
.tag_image
stage
:
deploy
environment
:
name
:
production
when
:
manual
variables
:
CI_REGISTRY_TAG
:
${CI_COMMIT_TAG}
TAG
:
stable
TOKEN
:
${SERVICE_ACCOUNT_TOKEN_DEV}
NAMESPACE
:
${NAMESPACE_DEV}
OPENSHIFT_SERVER
:
${OPENSHIFT_SERVER_DEV}
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