Added DockerJenkinsfile
This commit is contained in:
26
DockerJenkinsfile
Normal file
26
DockerJenkinsfile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
node {
|
||||||
|
label 'docker' //Agent needs to have Docker Engine installed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
// Get some code from a GIT repository
|
||||||
|
git 'https://git.agile611.com/Agile611/the-example-app-nodejs.git'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker Build') {
|
||||||
|
steps {
|
||||||
|
sh 'docker build -t the-example-app.nodejs .'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker Run') {
|
||||||
|
steps {
|
||||||
|
// Run Docker image on port 3000
|
||||||
|
sh 'docker run -p 3000:3000 -d the-example-app.nodejs'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user