Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
8624b132
Unverified
Commit
8624b132
authored
Aug 21, 2018
by
Joshua Arts
Committed by
GitHub
Aug 21, 2018
Browse files
Options
Downloads
Plain Diff
Merge pull request #250 from bruckwubete/staging
Added test stage to Jenkins CI
parents
81d460f1
ba50105d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+14
-1
14 additions, 1 deletion
Jenkinsfile
with
14 additions
and
1 deletion
Jenkinsfile
+
14
−
1
View file @
8624b132
...
@@ -11,7 +11,14 @@ if (env.TAG_NAME && env.TAG_NAME.contains("release")) {
...
@@ -11,7 +11,14 @@ if (env.TAG_NAME && env.TAG_NAME.contains("release")) {
kubecSecretsId
=
'gl-launcher-staging-secrets'
kubecSecretsId
=
'gl-launcher-staging-secrets'
}
}
properties
([
pipelineTriggers
([
githubPush
()
])
])
podTemplate
(
label:
label
,
cloud:
"${kubeCloud}"
,
containers:
[
podTemplate
(
label:
label
,
cloud:
"${kubeCloud}"
,
containers:
[
containerTemplate
(
name:
'ruby'
,
image:
"ruby:2.5.1"
,
command:
'cat'
,
ttyEnabled:
true
),
containerTemplate
(
name:
'gcloud'
,
image:
"gcr.io/ci-cd-for-bn/gcloud-docker"
,
command:
'cat'
,
ttyEnabled:
true
),
containerTemplate
(
name:
'gcloud'
,
image:
"gcr.io/ci-cd-for-bn/gcloud-docker"
,
command:
'cat'
,
ttyEnabled:
true
),
containerTemplate
(
name:
'kubectl'
,
image:
'gcr.io/cloud-builders/kubectl'
,
command:
'cat'
,
ttyEnabled:
true
)
containerTemplate
(
name:
'kubectl'
,
image:
'gcr.io/cloud-builders/kubectl'
,
command:
'cat'
,
ttyEnabled:
true
)
],
],
...
@@ -28,6 +35,12 @@ volumes: [
...
@@ -28,6 +35,12 @@ volumes: [
def
previousGitCommit
=
sh
(
script:
"git rev-parse ${gitCommit}~"
,
returnStdout:
true
)
def
previousGitCommit
=
sh
(
script:
"git rev-parse ${gitCommit}~"
,
returnStdout:
true
)
def
imageTag
=
"gcr.io/${project}/${appName}:${gitBranch}.${env.BUILD_NUMBER}.${gitCommit}"
def
imageTag
=
"gcr.io/${project}/${appName}:${gitBranch}.${env.BUILD_NUMBER}.${gitCommit}"
stage
(
'Test'
)
{
container
(
'ruby'
)
{
sh
"bundle install --without development production && bundle exec rubocop && bundle exec rspec"
}
}
stage
(
'Build and Publish'
)
{
stage
(
'Build and Publish'
)
{
container
(
'gcloud'
)
{
container
(
'gcloud'
)
{
withCredentials
([
file
(
credentialsId:
'cloud-datastore-user-account-creds'
,
variable:
'FILE'
)])
{
withCredentials
([
file
(
credentialsId:
'cloud-datastore-user-account-creds'
,
variable:
'FILE'
)])
{
...
@@ -50,7 +63,7 @@ volumes: [
...
@@ -50,7 +63,7 @@ volumes: [
container
(
'kubectl'
)
{
container
(
'kubectl'
)
{
withCredentials
([
file
(
credentialsId:
kubecSecretsId
,
variable:
'FILE'
)])
{
withCredentials
([
file
(
credentialsId:
kubecSecretsId
,
variable:
'FILE'
)])
{
sh
'''
sh
'''
kubectl
get pods && kubectl
apply -f $FILE
kubectl apply -f $FILE
'''
'''
}
}
sh
"kubectl set image deployments/gl-deployment gl=${imageTag}"
sh
"kubectl set image deployments/gl-deployment gl=${imageTag}"
...
...
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