-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
44 lines (41 loc) · 1.09 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def context = [:]
def app_name = "gpx-dashboard"
def namespace = "production"
pipeline {
agent any
parameters {
// build configs
string(name: "branch", defaultValue: "master", description: "Branch to build")
}
stages {
stage("Set contexts") {
steps{
script {
context.image = "${env.GCR_IMAGE_PREFIX}${app_name}:${namespace}-${env.BUILD_NUMBER}"
}
}
}
stage("Building Image") {
steps{
script {
context.dockerImage = docker.build("${context.image}", '-f ./Dockerfile .')
}
}
}
stage("Testing Image") {
steps{
sh "echo no tests"
}
}
stage("Push and Deploy") {
steps {
build job: 'push_and_deploy', parameters: [
[$class: 'StringParameterValue', name: 'full_image', value: context.image],
[$class: 'StringParameterValue', name: 'namespace', value: namespace],
[$class: 'StringParameterValue', name: 'app_name', value: app_name],
[$class: 'BooleanParameterValue', name: 'deploy', value: false],
]
}
}
}
}