-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
33 lines (29 loc) · 1.07 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
node {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: 'docker-hub', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS'],
]) {
stage('Login') {
sh """
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
"""
}
stage('Preparation') {
git 'https://github.com/andrenarciso4/docker-project.git'
}
stage('Build') {
app = docker.build("andrenarciso4/docker-jenkins","-f ./node/Dockerfile ./node")
}
stage('Push') {
withDockerRegistry([credentialsId: 'docker-hub']) {
app.push("${BUILD_NUMBER}")
app.push("latest")
}
}
stage('Deploy') {
sh """
helm upgrade --install docker-jenkins -f node/charts/javascript/values.yaml ./node/charts/javascript \
--set image.repository=andrenarciso4/docker-jenkins,image.tag=${BUILD_NUMBER},service.type=LoadBalancer
"""
}
}
}