-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
41 lines (41 loc) · 880 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
34
35
36
37
38
39
40
41
pipeline {
agent any
environment {
DH_CREDS=credentials('dh-creds')
}
stages {
stage('Remove all images from agent') {
steps {
sh 'podman rmi --all --force'
}
}
stage('build image') {
steps {
sh 'podman build -t darinpope/hello-world:2023-11-18 .'
}
}
stage('Login to Docker Hub') {
steps {
sh 'echo $DH_CREDS_PSW | podman login -u $DH_CREDS_USR --password-stdin docker.io'
}
}
stage('Tag the image') {
steps {
sh 'podman tag darinpope/hello-world:2023-11-18 darinpope/hello-world:latest'
}
}
stage('Push the image') {
steps {
sh '''
podman push darinpope/hello-world:2023-11-18
podman push darinpope/hello-world:latest
'''
}
}
}
post {
always {
sh 'podman logout docker.io'
}
}
}