Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node {
def commit_id
stage('Preparation') {
checkout scm
sh "git rev-parse --short HEAD > .git/commit-id"
commit_id = readFile('.git/commit-id').trim()
}

stage('docker build/push') {
docker.withRegistry('https://index.docker.io/v2/', 'dockerhub') {
def app = docker.build("yugant1/docker-nodejs-demo", '.').push()
}
}
stage('deploy') {
sh """
docker run -p 3000:3000 -d --name my-nodejs-app yugant1/docker-nodejs-demo
"""

}

}