Merge pull request #5 from Azure/master

Have 1 common azure-build-pipeline.yml file for the 4 apps (#14)
This commit is contained in:
Mathieu Benoit 2018-11-10 14:05:24 -05:00 коммит произвёл GitHub
Родитель 3081a4e826 5e793ae3f4
Коммит a6eaaf1097
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 5 добавлений и 137 удалений

Просмотреть файл

@ -169,14 +169,9 @@ Watch as more brady ninjas come to life!
## Leverage Azure DevOps
You could also leverage [Azure DevOps](https://docs.microsoft.com/azure/devops) to implement a [CI/CD pipeline](https://docs.microsoft.com/azure/devops/pipelines) for each app. For that you could [create one Azure build pipeline](https://docs.microsoft.com/azure/devops/pipelines/get-started-yaml#get-your-first-build) per app by using its associated YAML definition:
You could also leverage [Azure DevOps](https://docs.microsoft.com/azure/devops) to implement a [CI/CD pipeline](https://docs.microsoft.com/azure/devops/pipelines) for each app. For that you could [create one Azure build pipeline](https://docs.microsoft.com/azure/devops/pipelines/get-started-yaml#get-your-first-build) per app by using the associated YAML definition: [azure-build-pipeline.yml](azure-build-pipeline.yml).
- [parrot/azure-pipelines.yml](parrot/azure-pipelines.yml)
- [captainkube/azure-pipelines.yml](captainkube/azure-pipelines.yml)
- [phippy/azure-pipelines.yml](phippy/azure-pipelines.yml)
- [nodebrady/azure-pipelines.yml](nodebrady/azure-pipelines.yml)
*Coming soon: more to come, a blog article is coming explaining how to setup your Azure release pipeline. Stay tuned!*
*Coming soon: more to come, a blog article is coming explaining how to setup your Azure build and release pipelines. Stay tuned!*
## Issues?

Просмотреть файл

@ -4,9 +4,8 @@ pool:
variables:
registryServerName: '$(registryName).azurecr.io'
projectName: 'parrot'
imageName: '$(projectName)'
# define 4 more variables registryAzureSubscriptionServiceEndpoint, registryName, registryLogin and registryPassword in the build pipeline in UI
# define 4 more variables: projectName, registryName, registryLogin and registryPassword in the build pipeline in UI
steps:
@ -33,9 +32,6 @@ steps:
- bash: helm package --version $(build.buildId) --destination $(build.artifactStagingDirectory) $(system.defaultWorkingDirectory)/$(projectName)/charts/$(projectName)
displayName: 'helm package'
- task: AzureCLI@1
- bash: az acr helm push -n $(registryName) -u $(registryLogin) -p $(registryPassword) $(build.artifactStagingDirectory)/$(projectName)-$(build.buildId).tgz
displayName: 'az acr helm push'
inputs:
azureSubscription: '$(registryAzureSubscriptionServiceEndpoint)'
scriptLocation: inlineScript
inlineScript: 'az acr helm push -n $(registryName) $(build.artifactStagingDirectory)/$(projectName)-$(build.buildId).tgz'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))

Просмотреть файл

@ -1,41 +0,0 @@
pool:
vmImage: 'Ubuntu 16.04'
variables:
registryServerName: '$(registryName).azurecr.io'
projectName: 'captainkube'
imageName: '$(projectName)'
# define 4 more variables registryAzureSubscriptionServiceEndpoint, registryName, registryLogin and registryPassword in the build pipeline in UI
steps:
- bash: docker build -f $(system.defaultWorkingDirectory)/$(projectName)/Dockerfile -t $(registryServerName)/$(imageName):$(build.buildId) -t $(registryServerName)/$(imageName):latest $(system.defaultWorkingDirectory)/$(projectName)
displayName: 'docker build'
- bash: docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword)
displayName: 'docker login'
- bash: |
docker push $(registryServerName)/$(imageName):$(build.buildId)
docker push $(registryServerName)/$(imageName):latest
displayName: 'docker push'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
- task: HelmInstaller@0
displayName: 'Install Helm 2.11.0'
inputs:
helmVersion: 2.11.0
- bash: helm init --client-only --wait
displayName: 'helm init'
- bash: helm package --version $(build.buildId) --destination $(build.artifactStagingDirectory) $(system.defaultWorkingDirectory)/$(projectName)/charts/$(projectName)
displayName: 'helm package'
- task: AzureCLI@1
displayName: 'az acr helm push'
inputs:
azureSubscription: '$(registryAzureSubscriptionServiceEndpoint)'
scriptLocation: inlineScript
inlineScript: 'az acr helm push -n $(registryName) $(build.artifactStagingDirectory)/$(projectName)-$(build.buildId).tgz'

Просмотреть файл

@ -1,41 +0,0 @@
pool:
vmImage: 'Ubuntu 16.04'
variables:
registryServerName: '$(registryName).azurecr.io'
projectName: 'nodebrady'
imageName: '$(projectName)'
# define 4 more variables registryAzureSubscriptionServiceEndpoint, registryName, registryLogin and registryPassword in the build pipeline in UI
steps:
- bash: docker build -f $(system.defaultWorkingDirectory)/$(projectName)/Dockerfile -t $(registryServerName)/$(imageName):$(build.buildId) -t $(registryServerName)/$(imageName):latest $(system.defaultWorkingDirectory)/$(projectName)
displayName: 'docker build'
- bash: docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword)
displayName: 'docker login'
- bash: |
docker push $(registryServerName)/$(imageName):$(build.buildId)
docker push $(registryServerName)/$(imageName):latest
displayName: 'docker push'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
- task: HelmInstaller@0
displayName: 'Install Helm 2.11.0'
inputs:
helmVersion: 2.11.0
- bash: helm init --client-only --wait
displayName: 'helm init'
- bash: helm package --version $(build.buildId) --destination $(build.artifactStagingDirectory) $(system.defaultWorkingDirectory)/$(projectName)/charts/$(projectName)
displayName: 'helm package'
- task: AzureCLI@1
displayName: 'az acr helm push'
inputs:
azureSubscription: '$(registryAzureSubscriptionServiceEndpoint)'
scriptLocation: inlineScript
inlineScript: 'az acr helm push -n $(registryName) $(build.artifactStagingDirectory)/$(projectName)-$(build.buildId).tgz'

Просмотреть файл

@ -1,41 +0,0 @@
pool:
vmImage: 'Ubuntu 16.04'
variables:
registryServerName: '$(registryName).azurecr.io'
projectName: 'phippy'
imageName: '$(projectName)'
# define 4 more variables registryAzureSubscriptionServiceEndpoint, registryName, registryLogin and registryPassword in the build pipeline in UI
steps:
- bash: docker build -f $(system.defaultWorkingDirectory)/$(projectName)/Dockerfile -t $(registryServerName)/$(imageName):$(build.buildId) -t $(registryServerName)/$(imageName):latest $(system.defaultWorkingDirectory)/$(projectName)
displayName: 'docker build'
- bash: docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword)
displayName: 'docker login'
- bash: |
docker push $(registryServerName)/$(imageName):$(build.buildId)
docker push $(registryServerName)/$(imageName):latest
displayName: 'docker push'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
- task: HelmInstaller@0
displayName: 'Install Helm 2.11.0'
inputs:
helmVersion: 2.11.0
- bash: helm init --client-only --wait
displayName: 'helm init'
- bash: helm package --version $(build.buildId) --destination $(build.artifactStagingDirectory) $(system.defaultWorkingDirectory)/$(projectName)/charts/$(projectName)
displayName: 'helm package'
- task: AzureCLI@1
displayName: 'az acr helm push'
inputs:
azureSubscription: '$(registryAzureSubscriptionServiceEndpoint)'
scriptLocation: inlineScript
inlineScript: 'az acr helm push -n $(registryName) $(build.artifactStagingDirectory)/$(projectName)-$(build.buildId).tgz'