Initial commit: Hello Devops CI/CD
This commit is contained in:
22
Jenkinsfile
vendored
Normal file
22
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Build Docker Image') {
|
||||
steps {
|
||||
sh 'docker build -t hello-devops .'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Container') {
|
||||
steps {
|
||||
sh '''
|
||||
docker stop hello-devops || true
|
||||
docker rm hello-devops || true
|
||||
docker run -d --name hello-devops -p 5000:80 hello-devops
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user