forked from mbucknell/WQP_UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.build
85 lines (83 loc) · 2.34 KB
/
Jenkinsfile.build
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
75
76
77
78
79
80
81
82
83
84
85
@Library(value='PipelineLibs@0.6.1', changelog=false) _
def p
pipeline {
agent {
node {
label 'project:any'
}
}
parameters {
choice(choices: ['snapshots', 'releases'], description: 'type of build', name: 'BUILD_TYPE')
}
triggers {
pollSCM('H/5 * * * *')
}
stages {
stage('clean workspace') {
steps {
script {
pipelineUtils.cleanWorkspace()
}
}
}
stage('checkout source') {
steps {
script {
// clone the repo
pipelineUtils.cloneGitRepo()
}
script {
p = pipelineCfg('pipeline.yml')
}
}
}
stage('create virtualenv') {
steps {
script {
pipelineUtils.setUpPythonVirtualEnv()
pipelineUtils.pipInstall('--only-binary=bumpversion bumpversion==0.5.3')
}
}
}
stage('build assets docker image') {
steps {
script {
pipelineUtils.buildDockerImage('wqp_assets', './assets')
}
}
}
stage('build server docker image') {
steps {
script {
dockerPipeline.buildDockerArtifact(p.artifactoryPath, p.gitlabPath, p.dockerImageName, './server')
}
}
}
stage('publish docker images') {
steps {
script {
dockerPipeline.publishDockerImages(p.artifactoryPath, p.gitlabPath)
}
}
}
stage('push to git') {
steps {
script {
if ("${params.BUILD_TYPE}" == "releases") {
pipelineUtils.bumpVersion()
}
pipelineUtils.pushToGitRepo(p.gitRepoUrl, p.gitRepoCredentialsId)
}
}
}
stage('kick off deploy job') {
steps {
script {
if (p.containsKey('deployJobName')) {
pipelineUtils.triggerDeployJob(p.deployJobName)
}
}
}
}
}
}