diff --git a/Jenkinsfile b/Jenkinsfile index 715c5b58..669c690a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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"' } @@ -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 *' - } - } - } } \ No newline at end of file diff --git a/server.js b/server.js deleted file mode 100644 index 618252d6..00000000 --- a/server.js +++ /dev/null @@ -1,8 +0,0 @@ -var http = require('http'); - -http.createServer(function (req, res) { - - res.writeHead(200, { 'Content-Type': 'text/html' }); - res.end('Hello, Lidor!'); - -}).listen(process.env.PORT || 8081);