From 810b62f66ebde4fbd8c5a8425c6f5ac808abe257 Mon Sep 17 00:00:00 2001 From: Bruck Wubete Date: Tue, 21 Aug 2018 07:56:52 -0800 Subject: [PATCH] Added a Test stage --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c0c52e58..52a9c505 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,7 @@ if (env.TAG_NAME && env.TAG_NAME.contains("release")) { } podTemplate(label: label, cloud: "${kubeCloud}", containers: [ + containerTemplate(name: 'ruby', image: "ruby:2.5.1", command: 'cat', ttyEnabled: true), containerTemplate(name: 'gcloud', image: "gcr.io/ci-cd-for-bn/gcloud-docker", command: 'cat', ttyEnabled: true), containerTemplate(name: 'kubectl', image: 'gcr.io/cloud-builders/kubectl', command: 'cat', ttyEnabled: true) ], @@ -27,6 +28,12 @@ volumes: [ def shortGitCommit = "${gitCommit[0..10]}" def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true) def imageTag = "gcr.io/${project}/${appName}:${gitBranch}.${env.BUILD_NUMBER}.${gitCommit}" + + stage('Test') { + container('ruby') { + sh "bundle install && bundle exec rubocop && bundle exec rspec" + } + } stage('Build and Publish') { container('gcloud') {