This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuildJenkinsfile
67 lines (65 loc) · 1.96 KB
/
buildJenkinsfile
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
@Library(value='[email protected]', 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('prep workspace') {
steps {
script {
pipelineUtils.cloneGitRepo()
p = pipelineCfg('pipeline.yml')
}
}
}
stage('pull ojdbc jar from s3') {
steps {
sh "mkdir ${WORKSPACE}/oracle"
sh "aws s3 cp s3://owi-common-resources/resources/InstallFiles/oracle-jdbc-driver/ojdbc6-11.2.0.2.0-1.jar ${WORKSPACE}/oracle/ojdbc6-11.2.0.2.0-1.jar"
}
}
stage('build docker image') {
steps {
script {
pipelineUtils.setUpPythonVirtualEnv()
pipelineUtils.pipInstall('--only-binary=bumpversion bumpversion==0.5.3 requests')
dockerPipeline.buildDockerArtifact(p.artifactoryPath, p.gitlabPath, p.dockerImageName, './')
}
}
}
stage('publish docker image') {
steps {
script {
dockerPipeline.publishDockerImages(p.artifactoryPath, p.gitlabPath)
dockerPipeline.deleteDockerImages(p.artifactoryPath, 10, p.dockerImageName)
}
}
}
stage('push to git') {
steps {
script {
if ("${params.BUILD_TYPE}" == "releases") {
pipelineUtils.bumpVersion()
}
pipelineUtils.pushToGitRepo(p.gitRepoUrl, p.gitRepoCredentialsId)
}
}
}
}
}