forked from External/greenlight
		
	GRN2-yyy: Added initial cloudbuild scripts (#581)
* Initial cloudbuild scripts * Update sample.env * Update sample.env
This commit is contained in:
		
							
								
								
									
										31
									
								
								cloudbuild-staging.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								cloudbuild-staging.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					steps:
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/docker'
 | 
				
			||||||
 | 
					  entrypoint: 'bash'
 | 
				
			||||||
 | 
					  args: [
 | 
				
			||||||
 | 
					         '-c',
 | 
				
			||||||
 | 
					         'docker pull gcr.io/$PROJECT_ID/${_URL}:latest || exit 0'
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/docker'
 | 
				
			||||||
 | 
					  args: ['build',
 | 
				
			||||||
 | 
					          '--build-arg',
 | 
				
			||||||
 | 
					         'version_code=${BRANCH_NAME} (${SHORT_SHA})',
 | 
				
			||||||
 | 
					         '-t',
 | 
				
			||||||
 | 
					         'gcr.io/$PROJECT_ID/${_URL}:${BRANCH_NAME}.${SHORT_SHA}',
 | 
				
			||||||
 | 
					         '-t',
 | 
				
			||||||
 | 
					         'gcr.io/$PROJECT_ID/${_URL}:latest',
 | 
				
			||||||
 | 
					         '.']
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/kubectl'
 | 
				
			||||||
 | 
					  args: [
 | 
				
			||||||
 | 
					   'set', 
 | 
				
			||||||
 | 
					   'image', 
 | 
				
			||||||
 | 
					   'deployment', 
 | 
				
			||||||
 | 
					   '${_APP_NAME}', 
 | 
				
			||||||
 | 
					   '${_IMAGE_NAME}=gcr.io/$PROJECT_ID/${_URL}:${BRANCH_NAME}.${SHORT_SHA}'
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					  env:
 | 
				
			||||||
 | 
					  - 'CLOUDSDK_COMPUTE_ZONE=${_COMPUTE_ZONE}'
 | 
				
			||||||
 | 
					  - 'CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME}'
 | 
				
			||||||
 | 
					images: [
 | 
				
			||||||
 | 
					    'gcr.io/$PROJECT_ID/${_URL}:${BRANCH_NAME}.${SHORT_SHA}',
 | 
				
			||||||
 | 
					    'gcr.io/$PROJECT_ID/${_URL}:latest'
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
							
								
								
									
										31
									
								
								cloudbuild.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								cloudbuild.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					steps:
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/docker'
 | 
				
			||||||
 | 
					  entrypoint: 'bash'
 | 
				
			||||||
 | 
					  args: [
 | 
				
			||||||
 | 
					         '-c',
 | 
				
			||||||
 | 
					         'docker pull gcr.io/$PROJECT_ID/${_URL}:latest || exit 0'
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/docker'
 | 
				
			||||||
 | 
					  args: ['build',
 | 
				
			||||||
 | 
					         '--build-arg',
 | 
				
			||||||
 | 
					         'version_code=${TAG_NAME}',
 | 
				
			||||||
 | 
					         '-t',
 | 
				
			||||||
 | 
					         'gcr.io/$PROJECT_ID/${_URL}:${TAG_NAME}.${SHORT_SHA}',
 | 
				
			||||||
 | 
					         '-t',
 | 
				
			||||||
 | 
					         'gcr.io/$PROJECT_ID/${_URL}:latest',
 | 
				
			||||||
 | 
					         '.']
 | 
				
			||||||
 | 
					- name: 'gcr.io/cloud-builders/kubectl'
 | 
				
			||||||
 | 
					  args: [
 | 
				
			||||||
 | 
					   'set', 
 | 
				
			||||||
 | 
					   'image', 
 | 
				
			||||||
 | 
					   'deployment', 
 | 
				
			||||||
 | 
					   '${_APP_NAME}', 
 | 
				
			||||||
 | 
					   '${_IMAGE_NAME}=gcr.io/$PROJECT_ID/${_URL}:${TAG_NAME}.${SHORT_SHA}'
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					  env:
 | 
				
			||||||
 | 
					  - 'CLOUDSDK_COMPUTE_ZONE=${_COMPUTE_ZONE}'
 | 
				
			||||||
 | 
					  - 'CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME}'
 | 
				
			||||||
 | 
					images: [
 | 
				
			||||||
 | 
					    'gcr.io/$PROJECT_ID/${_URL}:${TAG_NAME}.${SHORT_SHA}',
 | 
				
			||||||
 | 
					    'gcr.io/$PROJECT_ID/${_URL}:latest'
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
		Reference in New Issue
	
	Block a user