-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (63 loc) · 1.53 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
def URL
def BRANCH
def CREDENTIALS
pipeline {
agent { label 'swarm' }
stages {
stage ('Checkout') {
steps {
script {
URL='http://gitlab.rindecuentas.org/equipo-qqw/poppins.git'
BRANCH='*/master'
CREDENTIALS='f28cf2d5-ce55-4f0b-9bad-c84376ce401d'
}
dir('new-dir') { sh 'pwd' }
ansiColor('xterm') {
checkout changelog: false, poll: false, scm:
[$class:
'GitSCM', branches: [[name: BRANCH]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs:
[[
credentialsId: CREDENTIALS,
url: URL
]]
]
}
echo "Clean container and Image"
sh 'bash docker_build.sh clean'
}
}
stage ('Build Image') {
agent { label 'swarm' }
steps {
script {
echo "Build container"
sh 'bash docker_build.sh build'
}
}
}
stage ('Test Image') {
agent { label 'swarm' }
steps {
script {
echo "Test container"
sh 'bash docker_build.sh test'
}
}
}
stage ('Release Image') {
agent { label 'swarm' }
steps {
script {
echo "Push container image to dockerhub registry"
sh 'bash docker_build.sh release'
echo "Clean container and Image"
sh 'bash docker_build.sh clean'
}
}
}
}
}