-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
34 lines (33 loc) · 935 Bytes
/
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
pipeline {
agent none
environment {
DH_USERNAME = credentials('dockerhub_username')
DH_PASSWORD = credentials('dockerhub_password')
}
stages {
stage('Build') {
agent {
label 'master'
}
steps {
echo "Realizando build previo a la subida"
sh '''
docker build -t weatherapp_backend .
'''
}
}
stage('TagAndPush') {
agent {
label 'master'
}
steps {
echo "Tag and Push"
sh '''
docker login --username ${DH_USERNAME} --password ${DH_PASSWORD}
docker tag weatherapp_backend jacevel97/weatherapp_backend:latest
docker push jacevel97/weatherapp_backend:latest
'''
}
}
}
}