Skip to content

Commit

Permalink
Update cloudbuild.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Marcin Kozlowski <[email protected]>
  • Loading branch information
marcinguy authored Jul 6, 2024
1 parent 93c97ba commit ebd0bba
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ steps:
gcloud config set project $PROJECT_ID
gcloud auth configure-docker
# Step to authenticate with Azure Container Registry (ACR) and get access token
- name: 'mcr.microsoft.com/azure-cli'
entrypoint: 'sh'
args:
- '-c'
- |
az login --service-principal -u ${_AZURE_CLIENT_ID} -p ${_AZURE_CLIENT_SECRET} --tenant ${_AZURE_TENANT_ID}
# Step to log in to ACR using Docker and the access token
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'sh'
args:
- '-c'
- |
docker login ${_AZURE_REGISTRY_NAME}.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password ${_ACCESS_TOKEN}
# Step to build and push worker-cli image to GCR
- name: 'gcr.io/cloud-builders/docker'
id: Build and push worker-cli image to GCR
Expand All @@ -50,31 +34,11 @@ steps:
'--file', 'docker/docker/worker-cli/Dockerfile'
]

# Step to build and push worker-cli image to ACR
- name: 'gcr.io/cloud-builders/docker'
id: Build and push worker-cli image to ACR
args:
[
'buildx', 'build', '.',
'--platform', 'linux/amd64,linux/arm64',
'--tag', '${_AZURE_REGISTRY_NAME}.azurecr.io/betterscan-ce-worker-cli:amd64-latest',
'--tag', '${_AZURE_REGISTRY_NAME}.azurecr.io/betterscan-ce-worker-cli:arm64-latest',
'--tag', '${_AZURE_REGISTRY_NAME}.azurecr.io/betterscan-ce-worker-cli:latest',
'--push',
'--file', 'docker/docker/worker-cli/Dockerfile'
]

images:
- 'gcr.io/$PROJECT_ID/betterscan-ce-worker-cli:latest'
- '${_AZURE_REGISTRY_NAME}.azurecr.io/betterscan-ce-worker-cli:latest'

options:
defaultLogsBucketBehavior: 'REGIONAL_USER_OWNED_BUCKET'

substitutions:
_AZURE_REGISTRY_NAME: 'your-registry-name'
_AZURE_CLIENT_ID: 'your-client-id'
_AZURE_CLIENT_SECRET: 'your-client-secret'
_AZURE_TENANT_ID: 'your-tenant-id'
_ACCESS_TOKEN: 'access-token'
_SERVICE_ACCOUNT_KEY: 'your-service-account-key'

0 comments on commit ebd0bba

Please sign in to comment.