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
53 changes: 4 additions & 49 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
pipeline {
agent any
stages {
stage('chekout code') {
stage('checkout code') {
parallel {
stage('chekout code') {
stage('checkout code') {
steps {
git(url: 'git@github.com:lidorg-dev/NodeJS-EmptySiteTemplate.git', branch: 'master', credentialsId: 'github')
git(url: 'git@github.com:asaf-haligua/NodeJS-EmptySiteTemplate.git', branch: 'master', credentialsId: 'githubas-jenkins ')
}
}

stage('say hello to me ') {
stage('say hello to me') {
steps {
sh 'echo "Hello"'
}
Expand All @@ -24,50 +24,5 @@ pipeline {
}
}

stage('Test App') {
parallel {
stage('Run the App') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'node server.js'
}

}
}

stage('check if app is running') {
steps {
sh '''sleep 5
curl localhost:8081
if [ $(echo $?) -eq 0 ];
then
echo "success"
ps -ef | grep node | awk \'{print $2}\' | head -n 1 | xargs kill
exit 0
else
echo "failure"
exit 1
fi '''
}
}

}
}

stage('Package') {
steps {
sh '''mkdir target && rsync -Rr . target/
tar -czvf package-$BUILD_ID.tar.gz target/
'''
}
}

stage('Archive Artifact') {
steps {
archiveArtifacts '*.tar.gz'
sh 'rm -rf *'
}
}

}
}
8 changes: 0 additions & 8 deletions server.js

This file was deleted.