forked from lidorg-dev/hello-world-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
37 lines (32 loc) · 673 Bytes
/
Jenkinsfile
File metadata and controls
37 lines (32 loc) · 673 Bytes
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
pipeline {
agent {
node {
label 'docker'
}
}
stages {
stage('checkout') {
steps {
git(url: 'https://github.com/YuvalSal99/hello-world-python.git', branch: 'master')
}
}
stage('build') {
steps {
sh 'docker build -t yuvalsal/hello-world-python:$BUILD_NUMBER .'
}
}
stage('Test') {
steps {
sh 'docker run -itd --name python -p 8080:8080 yuvalsal/hello-world-python:$BUILD_NUMBER'
sleep 5
sh 'curl localhost:8080'
sh 'docker stop python && docker rm python'
}
}
stage('push to dockerhub') {
steps {
sleep 5
}
}
}
}