forked from External/greenlight
		
	Added a Test stage
This commit is contained in:
		
							
								
								
									
										7
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
								
							@@ -12,6 +12,7 @@ if (env.TAG_NAME && env.TAG_NAME.contains("release")) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
podTemplate(label: label, cloud: "${kubeCloud}", containers: [
 | 
					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: '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)
 | 
					  containerTemplate(name: 'kubectl', image: 'gcr.io/cloud-builders/kubectl', command: 'cat', ttyEnabled: true)
 | 
				
			||||||
],
 | 
					],
 | 
				
			||||||
@@ -28,6 +29,12 @@ volumes: [
 | 
				
			|||||||
    def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true)
 | 
					    def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true)
 | 
				
			||||||
    def imageTag = "gcr.io/${project}/${appName}:${gitBranch}.${env.BUILD_NUMBER}.${gitCommit}"
 | 
					    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') {
 | 
					    stage('Build and Publish') {
 | 
				
			||||||
      container('gcloud') {
 | 
					      container('gcloud') {
 | 
				
			||||||
        withCredentials([file(credentialsId: 'cloud-datastore-user-account-creds', variable: 'FILE')]) {
 | 
					        withCredentials([file(credentialsId: 'cloud-datastore-user-account-creds', variable: 'FILE')]) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user