From 91d9f79506b4a906fe3f2853ba23eaad68f5382c Mon Sep 17 00:00:00 2001 From: sharadatal <56608981+sharadatal@users.noreply.github.com> Date: Tue, 15 Oct 2019 14:35:15 -0700 Subject: [PATCH 1/2] Update Jenkinsfile Update --- Jenkinsfile | 64 +---------------------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1837b48..f4a438f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,65 +1,3 @@ pipeline { - agent none - options { - buildDiscarder(logRotator(numToKeepStr: '2')) - skipDefaultCheckout true - } - stages { - stage('Web Tests') { - agent { - kubernetes { - label 'nodejs-devoptics' - yamlFile 'nodejs-pod.yaml' - } - } - when { - beforeAgent true - branch 'development' - } - stages { - stage('Nodejs Setup') { - steps { - checkout scm - container('nodejs') { - sh """ - npm i -S express pug - node ./hello.js & - """ - } - } - } - stage('Testcafe') { - steps { - container('testcafe') { - sh '/opt/testcafe/docker/testcafe-docker.sh "chromium --no-sandbox" tests/*.js -r xunit:res.xml' - } - } - } - } - post { - success { - stash name: 'app', includes: '*.js, public/**, views/*, Dockerfile' - } - always { - junit 'res.xml' - } - } - } - stage('Build and Push Image') { - agent { - kubernetes { - label 'nodejs' - yamlFile 'nodejs-pod.yaml' - } - } - when { - beforeAgent true - branch 'master' - } - steps { - checkout scm - echo "TODO - build and push image" - } - } - } + } From 0d85bf185152f59cb6dae645290a95f4e2fd7954 Mon Sep 17 00:00:00 2001 From: sharadatal <56608981+sharadatal@users.noreply.github.com> Date: Tue, 15 Oct 2019 16:05:08 -0700 Subject: [PATCH 2/2] Update Jenkinsfile --- Jenkinsfile | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4a438f..3cdec60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,28 @@ pipeline { - + agent none + options { + buildDiscarder(logRotator(numToKeepStr: '2')) + skipDefaultCheckout true + } + stages { + stage('Test') { + agent { label 'nodejs-app' } + steps { + checkout scm + container('nodejs') { + echo 'Hello World!' + sh 'node --version' + } + } + } + stage('Build and Push Image') { + when { + beforeAgent true + branch 'master' + } + steps { + echo "TODO - build and push image" + } + } + } }