Added new pipelines and templates
This commit is contained in:
		
							parent
							
								
									bc4bc18abc
								
							
						
					
					
						commit
						3656c57b64
					
				| @ -1,5 +1,7 @@ | ||||
| variables: | ||||
|   ProjectName: Basket.API | ||||
|   OpenShiftProject: development | ||||
|   AppName: basketapi | ||||
| trigger: | ||||
|   branches: | ||||
|     include: | ||||
| @ -10,6 +12,11 @@ trigger: | ||||
|     - src/BuildingBlocks/* | ||||
|     - src/Services/Basket/* | ||||
| jobs: | ||||
| - template: ../webapp-build.yml | ||||
| - template: ../webapp-build-artifacts.yml | ||||
|   parameters: | ||||
|     ProjectName: $(ProjectName) | ||||
| - template: ../webapp-container-build.yml | ||||
|   parameters: | ||||
|     ProjectName: $(ProjectName) | ||||
|     OpenShiftProject: $(OpenShiftProject) | ||||
|     AppName: $(AppName) | ||||
|  | ||||
| @ -10,6 +10,6 @@ trigger: | ||||
|     - src/BuildingBlocks/* | ||||
|     - src/Services/Catalog/* | ||||
| jobs: | ||||
| - template: ../webapp-build.yml | ||||
| - template: ../webapp-build-artifacts.yml | ||||
|   parameters: | ||||
|     ProjectName: $(ProjectName) | ||||
|  | ||||
| @ -10,6 +10,6 @@ trigger: | ||||
|     - src/BuildingBlocks/* | ||||
|     - src/Services/Catalog/* | ||||
| jobs: | ||||
| - template: ../webapp-build.yml | ||||
| - template: ../webapp-build-artifacts.yml | ||||
|   parameters: | ||||
|     ProjectName: $(ProjectName) | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| # Azure DevOps build definitions | ||||
| # ARO build definitions | ||||
| 
 | ||||
| This folder contains the Azure DevOps build definitions in YAML format. Each folder contains one `azure-pipelines.yml` that contains the build definition for one microservice (usually a Docker image, but some microservices generates more than one Docker image). | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										47
									
								
								build/aro/webapp-container-build.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								build/aro/webapp-container-build.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| parameters: | ||||
|   ProjectName: '' | ||||
|   OpenShiftProject: '' | ||||
|   AppName: '' | ||||
| jobs: | ||||
| - job: Container_Build | ||||
|   pool:  | ||||
|     name: 'Hosted Ubuntu 1604' | ||||
|   steps: | ||||
|   - task: redhat.openshift-vsts.oc-setup-task.oc-setup@2 | ||||
|     displayName: 'oc-setup ' | ||||
|     inputs: | ||||
|     openshiftService: 'OpenShift on ARO DEV' | ||||
|   - script: 'oc project $(OpenShiftProject)' | ||||
|     failOnStderr: true | ||||
|     displayName: 'Set Project Context' | ||||
|   - powershell: | | ||||
|       $pinfo = New-Object System.Diagnostics.ProcessStartInfo | ||||
|       $pinfo.FileName = "oc.exe" | ||||
|       $pinfo.RedirectStandardError = $true | ||||
|       $pinfo.RedirectStandardOutput = $true | ||||
|       $pinfo.UseShellExecute = $false | ||||
|       $pinfo.Arguments = "get buildConfig $(AppName)-build" | ||||
|       $p = New-Object System.Diagnostics.Process | ||||
|       $p.StartInfo = $pinfo | ||||
|       $p.Start() | Out-Null | ||||
|       $p.WaitForExit() | ||||
|       $stdout = $p.StandardOutput.ReadToEnd() | ||||
|       $stderr = $p.StandardError.ReadToEnd() | ||||
|       Write-Host "stdout: $stdout" | ||||
|       Write-Host "stderr: $stderr" | ||||
|       Write-Host "exit code: " + $p.ExitCode | ||||
|       $buildExists = $stdout.Contains("$(AppName)-build") | ||||
|       Write-Host "##vso[task.setvariable variable=BuildExists;]$buildExists" | ||||
|     displayName: 'Check for Existing Build' | ||||
|   - script: 'oc new-build --name=$(AppName)-build dotnet:3.1 --binary=true' | ||||
|     failOnStderr: true | ||||
|     displayName: 'Create OpenShift Build' | ||||
|     condition: and(succeeded(), eq(variables['BuildExists'], False)) | ||||
|   - script: 'oc start-build $(AppName)-build --from-dir="$(Build.ArtifactStagingDirectory)/$(ProjectName)" --follow --wait' | ||||
|     failOnStderr: true | ||||
|     displayName: 'Start OpenShift Binary Build' | ||||
|     continueOnError: true | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
							
								
								
									
										118
									
								
								deploy/aro/basket-api/basket-api-aro-template.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								deploy/aro/basket-api/basket-api-aro-template.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,118 @@ | ||||
| apiVersion: template.openshift.io/v1 | ||||
| kind: Template | ||||
| metadata: | ||||
|   creationTimestamp: null | ||||
|   name: '''basketapi-template''' | ||||
| objects: | ||||
| - apiVersion: apps.openshift.io/v1 | ||||
|   kind: DeploymentConfig | ||||
|   metadata: | ||||
|     annotations: | ||||
|       openshift.io/generated-by: OpenShiftNewApp | ||||
|     creationTimestamp: null | ||||
|     generation: 6 | ||||
|     labels: | ||||
|       app: basketapi | ||||
|     name: basketapi | ||||
|   spec: | ||||
|     replicas: 1 | ||||
|     revisionHistoryLimit: 10 | ||||
|     selector: | ||||
|       app: basketapi | ||||
|       deploymentconfig: basketapi | ||||
|     strategy: | ||||
|       activeDeadlineSeconds: 21600 | ||||
|       resources: {} | ||||
|       rollingParams: | ||||
|         intervalSeconds: 1 | ||||
|         maxSurge: 25% | ||||
|         maxUnavailable: 25% | ||||
|         timeoutSeconds: 600 | ||||
|         updatePeriodSeconds: 1 | ||||
|       type: Rolling | ||||
|     template: | ||||
|       metadata: | ||||
|         annotations: | ||||
|           openshift.io/generated-by: OpenShiftNewApp | ||||
|         creationTimestamp: null | ||||
|         labels: | ||||
|           app: basketapi | ||||
|           deploymentconfig: basketapi | ||||
|       spec: | ||||
|         containers: | ||||
|         - image: docker-registry.default.svc:5000/development/basketapi-build@sha256:7149637592a2e9bbfa78836762a5c300f6b19220ca001902e4c6c1767cb19c3d | ||||
|           imagePullPolicy: Always | ||||
|           livenessProbe: | ||||
|             failureThreshold: 3 | ||||
|             httpGet: | ||||
|               path: /liveness | ||||
|               port: 8080 | ||||
|               scheme: HTTP | ||||
|             initialDelaySeconds: 10 | ||||
|             periodSeconds: 10 | ||||
|             successThreshold: 1 | ||||
|             timeoutSeconds: 3 | ||||
|           name: basketapi | ||||
|           ports: | ||||
|           - containerPort: 8080 | ||||
|             protocol: TCP | ||||
|           readinessProbe: | ||||
|             failureThreshold: 3 | ||||
|             httpGet: | ||||
|               path: /hc | ||||
|               port: 8080 | ||||
|               scheme: HTTP | ||||
|             initialDelaySeconds: 10 | ||||
|             periodSeconds: 10 | ||||
|             successThreshold: 1 | ||||
|             timeoutSeconds: 10 | ||||
|           resources: {} | ||||
|           terminationMessagePath: /dev/termination-log | ||||
|           terminationMessagePolicy: File | ||||
|         dnsPolicy: ClusterFirst | ||||
|         restartPolicy: Always | ||||
|         schedulerName: default-scheduler | ||||
|         securityContext: {} | ||||
|         terminationGracePeriodSeconds: 30 | ||||
|     test: false | ||||
|     triggers: | ||||
|     - type: ConfigChange | ||||
|     - imageChangeParams: | ||||
|         automatic: true | ||||
|         containerNames: | ||||
|         - basketapi | ||||
|         from: | ||||
|           kind: ImageStreamTag | ||||
|           name: basketapi-build:latest | ||||
|           namespace: development | ||||
|         lastTriggeredImage: docker-registry.default.svc:5000/development/basketapi-build@sha256:7149637592a2e9bbfa78836762a5c300f6b19220ca001902e4c6c1767cb19c3d | ||||
|       type: ImageChange | ||||
|   status: | ||||
|     availableReplicas: 0 | ||||
|     latestVersion: 0 | ||||
|     observedGeneration: 0 | ||||
|     replicas: 0 | ||||
|     unavailableReplicas: 0 | ||||
|     updatedReplicas: 0 | ||||
| - apiVersion: v1 | ||||
|   kind: Service | ||||
|   metadata: | ||||
|     annotations: | ||||
|       openshift.io/generated-by: OpenShiftNewApp | ||||
|     creationTimestamp: null | ||||
|     labels: | ||||
|       app: basketapi | ||||
|     name: basketapi | ||||
|   spec: | ||||
|     ports: | ||||
|     - name: 8080-tcp | ||||
|       port: 8080 | ||||
|       protocol: TCP | ||||
|       targetPort: 8080 | ||||
|     selector: | ||||
|       app: basketapi | ||||
|       deploymentconfig: basketapi | ||||
|     sessionAffinity: None | ||||
|     type: ClusterIP | ||||
|   status: | ||||
|     loadBalancer: {} | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user