Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 12 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
pipeline {
agent any

stages {
stage("Initialize") {
stage('cleanWs') {
steps {
cleanWs()
}
}
stage('Get SCM') {
stage('pull') {
steps {
git "https://github.com/ranazrad/simple-webapp-nodejs.git"
sh "cat Jenkinsfile"
git 'https://github.com/pazifargan/simple-webapp-nodejs.git'
}
}
stage('Build') {
stage('build') {
steps {
sh "docker build -t nodewebapp ."
sh "docker images"
nodejs('nodejs8') {
sh 'npm install'
}
}
}
stage('Deploy') {
stage('test') {
steps {
sh "docker kill nodewebapp"
sh "docker rm nodewebapp"
sh "docker run -itd --name nodewebapp -p 8081:3000 nodewebapp:latest &"
nodejs('nodejs8') {
sh 'npm test'
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ block content
h1= title
p Welcome to Your Web Application

//Remove the follwoing comments and tigger the CI\CD pipeline (Make sure to ident correctly)
//Remove the follwoing comments and tigger the CI\CD pipeline (Make sure to ident correctly).
<style> h3 { color: #00B56C; } </style>
h3 This application was deployed using CI\CD (docker pipeline) by Jenkins