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
4c842c8e
Commit
4c842c8e
authored
Aug 21, 2018
by
Joshua Arts
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:bigbluebutton/greenlight
parents
d7db798a
effcf891
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.dockerignore
+1
-0
1 addition, 0 deletions
.dockerignore
Jenkinsfile
+60
-0
60 additions, 0 deletions
Jenkinsfile
with
61 additions
and
0 deletions
.dockerignore
+
1
−
0
View file @
4c842c8e
...
@@ -21,3 +21,4 @@ spec/tmp
...
@@ -21,3 +21,4 @@ spec/tmp
.byebug_history
.byebug_history
vendor/bundle
vendor/bundle
.bundle
.bundle
Jenkinsfile
This diff is collapsed.
Click to expand it.
Jenkinsfile
0 → 100644
+
60
−
0
View file @
4c842c8e
def
project
=
'ci-cd-for-bn'
def
appName
=
'greenlight'
def
greenlightVersion
=
'v2'
def
label
=
"jenkins-execution-worker-${UUID.randomUUID().toString()}"
if
(
env
.
TAG_NAME
&&
env
.
TAG_NAME
.
contains
(
"release"
))
{
kubeCloud
=
"production"
kubecSecretsId
=
'gl-launcher-prod-secrets'
}
else
{
kubeCloud
=
"staging"
kubecSecretsId
=
'gl-launcher-staging-secrets'
}
podTemplate
(
label:
label
,
cloud:
"${kubeCloud}"
,
containers:
[
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
)
],
volumes:
[
hostPathVolume
(
mountPath:
'/usr/bin/docker'
,
hostPath:
'/usr/bin/docker'
),
hostPathVolume
(
mountPath:
'/var/run/docker.sock'
,
hostPath:
'/var/run/docker.sock'
)
]){
node
(
label
)
{
def
myRepo
=
checkout
scm
def
gitCommit
=
myRepo
.
GIT_COMMIT
def
gitBranch
=
myRepo
.
GIT_BRANCH
def
gitTag
=
env
.
TAG_NAME
def
shortGitCommit
=
"${gitCommit[0..10]}"
def
previousGitCommit
=
sh
(
script:
"git rev-parse ${gitCommit}~"
,
returnStdout:
true
)
def
imageTag
=
"gcr.io/${project}/${appName}:${gitBranch}.${env.BUILD_NUMBER}.${gitCommit}"
stage
(
'Build and Publish'
)
{
container
(
'gcloud'
)
{
withCredentials
([
file
(
credentialsId:
'cloud-datastore-user-account-creds'
,
variable:
'FILE'
)])
{
sh
"gcloud auth activate-service-account --key-file=$FILE"
if
(
kubeCloud
==
"staging"
)
{
sh
"gcloud docker -- build -t ${imageTag} . && gcloud docker -- push ${imageTag}"
}
else
{
imageTag
=
"gcr.io/${project}/${appName}:${gitTag}"
withCredentials
([
string
(
credentialsId:
'DOCKER_USER'
,
variable:
'DOCKER_USER'
),
string
(
credentialsId:
'DOCKER_PASSWORD'
,
variable:
'DOCKER_PASSWORD'
)])
{
sh
"gcloud docker -- build -t ${imageTag} -t '$DOCKER_USER/${appName}:${greenlightVersion}' -t '$DOCKER_USER/${appName}:${gitTag}' . && gcloud docker -- push ${imageTag}"
sh
"docker login -u $DOCKER_USER -p $DOCKER_PASSWORD"
sh
"docker push '$DOCKER_USER/${appName}:${greenlightVersion}' && docker push '$DOCKER_USER/${appName}:${gitTag}'"
}
}
}
}
}
stage
(
'Deploy'
)
{
container
(
'kubectl'
)
{
withCredentials
([
file
(
credentialsId:
kubecSecretsId
,
variable:
'FILE'
)])
{
sh
'''
kubectl get pods && kubectl apply -f $FILE
'''
}
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