Skip to content

Commit

Permalink
test acr task run
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Feb 6, 2024
1 parent 6a02106 commit fd84e0a
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ jobs:
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
subscription-id: ${{matrix.target.subscription-id}}

- name: Generate image tag
id: tag
run: |
sha=${GITHUB_SHA::8}
ts=$(date +%s)
echo "tag=${GITHUB_REF_NAME}-${sha}-${ts}" >> $GITHUB_OUTPUT
- name: Build image
env:
AZURE_SUBSCRIPTION_ID: ${{matrix.target.subscription-id}}
ACR_NAME: ${{matrix.target.acr-name}}
image_tag: ${{matrix.target.acr-name}}.azurecr.io/${IMAGE_NAME}:${GITHUB_REF_NAME}-${GITHUB_SHA::8}-$(date +%s)
IMAGE_NAME: radix-vulnerability-scanner
run: |
echo az acr task run \
Expand All @@ -57,20 +63,9 @@ jobs:
--file ${GITHUB_WORKSPACE}/Dockerfile \
--set DOCKER_REGISTRY=${ACR_NAME} \
--set BRANCH=${GITHUB_REF_NAME} \
--set TAGS="--tag ${image_tag}" \
--set TAGS="--tag ${ACR_NAME}.azurecr.io/${IMAGE_NAME}:${{steps.tag.outputs.tag}}" \
--set DOCKER_FILE_NAME=Dockerfile \
--set PUSH="--push" \
--set REPOSITORY_NAME=${IMAGE_NAME} \
--set CACHE="" \
--set CACHE_TO_OPTIONS="--cache-to=type=registry,ref=${ACR_NAME}.azurecr.io/${IMAGE_NAME}:radix-cache-${GITHUB_REF_NAME},mode=max"
#
# az acr task run
# --subscription 16ede44b-1f74-40a5-b428-46cca9a5741b
# --name radix-image-builder-internal
# --registry radixdev
# --context /home/runner/work/radix-vulnerability-scanner/radix-vulnerability-scanner
# --file /home/runner/work/radix-vulnerability-scanner/radix-vulnerability-scanner/Dockerfile
# --set DOCKER_REGISTRY=radixdev
# --set BRANCH=39/merge
# --set TAGS=--tag radixdev.azurecr.io/${radix-vulnerability-scanner}:${GITHUB_REF_NAME}-${GITHUB_SHA::8}-$(date +%s) --set DOCKER_FILE_NAME=Dockerfile --set PUSH=--push --set REPOSITORY_NAME=radix-vulnerability-scanner --set CACHE= --set CACHE_TO_OPTIONS=--cache-to=type=registry,ref=radixdev.azurecr.io/radix-vulnerability-scanner:radix-cache-39/merge,mode=max

0 comments on commit fd84e0a

Please sign in to comment.