Skip to content

Commit

Permalink
Merge pull request #116 from stuartleeks/sl/azdo-tests
Browse files Browse the repository at this point in the history
Expand Azure DevOps tests
  • Loading branch information
stuartleeks authored Jun 1, 2022
2 parents 6890eea + 321754d commit f4b5955
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 2 deletions.
105 changes: 104 additions & 1 deletion .azure-devops/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,107 @@ jobs:
runCmd: 'echo $PWD'
subFolder: '.'
env: ''
imageTag: $(IMAGE_TAG)
imageTag: $(IMAGE_TAG)
sourceBranchFilterForPush: ''

- job: test_run_args
displayName: Test run-args
steps:
- script: |
docker login -u $ACR_USERNAME -p $ACR_TOKEN $(ACR_NAME).azurecr.io
displayName: 'Log in to Azure Container Registry'
env:
ACR_NAME: $(ACR_NAME)
ACR_TOKEN: $(ACR_TOKEN)
ACR_USERNAME: $(ACR_USERNAME)
- script: |
printenv | sort
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/stuartleeks/azdo-devcontainer-build-run/test/run-args'
subFolder: github-tests/run-args
runCmd: echo $HOSTNAME && [[ $HOSTNAME == "my-host" ]]
env: ''
imageTag: $(IMAGE_TAG)
sourceBranchFilterForPush: ''

- job: test_build_args
displayName: Test build-args
steps:
- script: |
docker login -u $ACR_USERNAME -p $ACR_TOKEN $(ACR_NAME).azurecr.io
displayName: 'Log in to Azure Container Registry'
env:
ACR_NAME: $(ACR_NAME)
ACR_TOKEN: $(ACR_TOKEN)
ACR_USERNAME: $(ACR_USERNAME)
- script: |
printenv | sort
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/stuartleeks/azdo-devcontainer-build-run/test/build-args'
subFolder: github-tests/build-args
runCmd: echo $BUILD_ARG_TEST && [[ $BUILD_ARG_TEST == "Hello build-args!" ]]
env: ''
imageTag: $(IMAGE_TAG)
sourceBranchFilterForPush: ''

- job: test_dockerfile_context
displayName: Test Dockerfile context
steps:
- script: |
docker login -u $ACR_USERNAME -p $ACR_TOKEN $(ACR_NAME).azurecr.io
displayName: 'Log in to Azure Container Registry'
env:
ACR_NAME: $(ACR_NAME)
ACR_TOKEN: $(ACR_TOKEN)
ACR_USERNAME: $(ACR_USERNAME)
- script: |
printenv | sort
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/stuartleeks/azdo-devcontainer-build-run/test/dockerfile-context'
subFolder: github-tests/dockerfile-context
runCmd: /tmp/dummy.sh
env: ''
imageTag: $(IMAGE_TAG)
sourceBranchFilterForPush: ''

- job: test_feature_docker_from_docker
displayName: Test docker-from-docker using feature
steps:
- script: |
docker login -u $ACR_USERNAME -p $ACR_TOKEN $(ACR_NAME).azurecr.io
displayName: 'Log in to Azure Container Registry'
env:
ACR_NAME: $(ACR_NAME)
ACR_TOKEN: $(ACR_TOKEN)
ACR_USERNAME: $(ACR_USERNAME)
- script: |
printenv | sort
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/stuartleeks/azdo-devcontainer-build-run/test/feature-docker-from-docker'
subFolder: github-tests/feature-docker-from-docker
runCmd: make docker-build
env: ''
imageTag: $(IMAGE_TAG)
sourceBranchFilterForPush: ''


3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"davidanson.vscode-markdownlint",
"heaths.vscode-guid",
"esbenp.prettier-vscode",
"meganrogge.template-string-converter"
"meganrogge.template-string-converter",
"ms-azure-devops.azure-pipelines"
],
"features": {
"github-cli": "latest"
Expand Down

0 comments on commit f4b5955

Please sign in to comment.