-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.build
86 lines (84 loc) · 2.4 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
86
@Library(value='[email protected]', changelog=false) _
def p
def deployConfigs
pipeline {
agent {
node {
label 'team:iow'
}
}
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 requests boto3 pyyaml chevron')
}
}
}
stage('pull scripts') {
steps {
script {
pipelineUtils.pullEcsScripts()
}
}
}
stage('build assets docker image') {
steps {
script {
pipelineUtils.buildDockerImage('wqp_assets', './assets')
}
}
}
stage('build server docker image') {
steps {
script {
version = pipelineUtils.bumpVersion(params.BUILD_TYPE)
buildConfigs = p['docker_build'] ?: [p]
deployConfigs = dockerPipeline.buildPublishAndCleanUpDockerImages(buildConfigs, version)
}
}
}
stage('push to git') {
steps {
script {
if ("${params.BUILD_TYPE}" == "releases") {
pipelineUtils.incrementToNextDevelopmentVersion()
pipelineUtils.pushToGitRepo(p.gitRepoUrl, p.gitRepoCredentialsId)
}
}
}
}
stage('deploy image') {
steps {
script {
dockerPipeline.deployImages(deployConfigs)
}
}
}
}
}