Created
July 5, 2021 18:32
-
-
Save alwalker/125667ebc903029c1f6b115f8a24a771 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- deploy | |
docker-build: | |
image: docker:latest | |
stage: build | |
services: | |
- docker:dind | |
before_script: | |
- docker login -u "myreg" -p $AZ_REG_PASSWORD myreg.azurecr.io | |
script: | |
- cd samples/aspnetapp | |
- docker build --pull -t "myreg.azurecr.io/testapp:$CI_PIPELINE_ID" . | |
- docker push "myreg.azurecr.io/testapp:$CI_PIPELINE_ID" | |
docker-deploy-dev: | |
image: mcr.microsoft.com/azure-cli | |
stage: deploy | |
environment: | |
name: dev | |
script: | |
- az login --service-principal -u http://myapp -p $AZURE_SECRET --tenant AZ_AD_TENANT | |
- az webapp config container set --docker-custom-image-name "myreg.azurecr.io/testapp:$CI_PIPELINE_ID" --docker-registry-server-password $AZ_REG_PASSWORD --docker-registry-server-url https://myreg.azurecr.io --docker-registry-server-user myreg --name "my-app-dev" --resource-group my-rg | |
docker-deploy-prod: | |
image: mcr.microsoft.com/azure-cli | |
stage: deploy | |
when: manual | |
environment: | |
name: dev | |
script: | |
- az login --service-principal -u http://myapp -p $AZURE_SECRET --tenant AZ_AD_TENANT | |
- az webapp config container set --docker-custom-image-name "myreg.azurecr.io/testapp:$CI_PIPELINE_ID" --docker-registry-server-password $AZ_REG_PASSWORD --docker-registry-server-url https://myreg.azurecr.io --docker-registry-server-user myreg --name "my-app-prod" --resource-group my-rg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment