forked from cloudflare/cfssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
74 lines (65 loc) · 1.94 KB
/
Jenkinsfile
File metadata and controls
74 lines (65 loc) · 1.94 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@Library("release-pipeline") _
def appName = 'cfssl-intelity'
def allServices = [appName]
def defaultBranch = 'master'
IS_DEFAULT_BRANCH = env.BRANCH_NAME == defaultBranch
pipeline {
agent any
parameters {
booleanParam(
name: 'DEPLOY_TO_DEV',
description: 'Check to deploy working branch to dev',
defaultValue: IS_DEFAULT_BRANCH,
)
booleanParam(
name: 'PUBLISH_IMAGE',
description: 'Check to publish docker images',
defaultValue: IS_DEFAULT_BRANCH,
)
}
options {
disableConcurrentBuilds()
timeout(time: 15, unit: 'MINUTES')
ansiColor('xterm')
timestamps()
}
stages {
stage('Checkout') {
steps {
ansiColor('xterm') {
println '\033[1;4;37;42mStage "Checkout"\033[0m'
}
gitCheckout()
}
}
stage('Build images') {
steps {
ansiColor('xterm') {
println '\033[1;4;37;42mStage "Build docker image"\033[0m'
}
script {
commitId = gitCommitId()
appEnv = dockerBuild(appName, commitId, ['dockerFile': "Dockerfile.minimal"])
dockerTag(appName, commitId, allServices)
}
}
}
stage('Publish & Deploy') {
steps {
ansiColor('xterm') {
println '\033[1;4;37;42mStage "Publish and deploy chart"\033[0m'
}
k8sDeploy(appName, [
forceDevDeployment: params.DEPLOY_TO_DEV,
forcePublish : params.PUBLISH_IMAGE,
deployments : allServices
])
}
}
}
post {
always {
deleteDir()
}
}
}