Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bq-workers/argocd-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ steps:
- # Build argocd-parser image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/argocd-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/argocd-parser:${_TAG}', '.']
dir: 'bq-workers/argocd-parser'
id: build

- # Push the container image to Artifact Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/argocd-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/argocd-parser:${_TAG}']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'argocd-parser',
'--image', 'gcr.io/$PROJECT_ID/argocd-parser:${_TAG}',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/argocd-parser:${_TAG}',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/argocd-parser:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/argocd-parser:${_TAG}'
]
8 changes: 4 additions & 4 deletions bq-workers/circleci-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build circleci worker image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/circleci-parser', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/circleci-parser', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/circleci-parser']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/circleci-parser']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'circleci-parser',
'--image', 'gcr.io/$PROJECT_ID/circleci-parser',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/circleci-parser',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/circleci-parser'
'${_GCR_DOMAIN}/$PROJECT_ID/circleci-parser'
]
8 changes: 4 additions & 4 deletions bq-workers/cloud-build-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build cloud-build-parser image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/cloud-build-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/cloud-build-parser:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/cloud-build-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/cloud-build-parser:${_TAG}']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'cloud-build-parser',
'--image', 'gcr.io/$PROJECT_ID/cloud-build-parser:${_TAG}',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/cloud-build-parser:${_TAG}',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/cloud-build-parser:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/cloud-build-parser:${_TAG}'
]
6 changes: 3 additions & 3 deletions bq-workers/github-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ steps:
- # Build github-parser image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/github-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/github-parser:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/github-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/github-parser:${_TAG}']
waitFor: build
id: push

images: [
'gcr.io/$PROJECT_ID/github-parser:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/github-parser:${_TAG}'
]
8 changes: 4 additions & 4 deletions bq-workers/gitlab-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build new-source worker image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/gitlab-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/gitlab-parser:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/gitlab-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/gitlab-parser:${_TAG}']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'gitlab-parser',
'--image', 'gcr.io/$PROJECT_ID/gitlab-parser:${_TAG}',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/gitlab-parser:${_TAG}',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/gitlab-parser'
'${_GCR_DOMAIN}/$PROJECT_ID/gitlab-parser'
]
8 changes: 4 additions & 4 deletions bq-workers/new-source-template/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build new-source worker image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/${_SOURCE}-parser', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/${_SOURCE}-parser', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/${_SOURCE}-parser']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/${_SOURCE}-parser']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', '${_SOURCE}-parser',
'--image', 'gcr.io/$PROJECT_ID/${_SOURCE}-parser',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/${_SOURCE}-parser',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/${_SOURCE}-parser'
'${_GCR_DOMAIN}/$PROJECT_ID/${_SOURCE}-parser'
]
8 changes: 4 additions & 4 deletions bq-workers/pagerduty-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build pagerduty-parser image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/pagerduty-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/pagerduty-parser:${_TAG}', '.']
id: build

- # Push the container image to Artifact Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/default/pagerduty-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/default/pagerduty-parser:${_TAG}']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'pagerduty-parser',
'--image', 'gcr.io/$PROJECT_ID/default/pagerduty-parser:${_TAG}',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/default/pagerduty-parser:${_TAG}',
'--region', '${_FOURKEYS_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/pagerduty-parser:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/pagerduty-parser:${_TAG}'
]
7 changes: 4 additions & 3 deletions bq-workers/parsers.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ steps:
name: gcr.io/cloud-builders/docker:latest
dir: ${_SERVICE}-parser
args: ['build',
'--tag=gcr.io/$PROJECT_ID/${_SERVICE}-parser:${_TAG}', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/${_SERVICE}-parser:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/${_SERVICE}-parser:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/${_SERVICE}-parser:${_TAG}']
waitFor: build
id: push

images: [
'gcr.io/$PROJECT_ID/${_SERVICE}-parser:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/${_SERVICE}-parser:${_TAG}'
]
substitutions:
_TAG: latest
_GCR_DOMAIN: gcr.io
8 changes: 4 additions & 4 deletions bq-workers/tekton-parser/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ steps:
- # Build tekton worker image
name: gcr.io/cloud-builders/docker:latest
args: ['build',
'--tag=gcr.io/$PROJECT_ID/tekton-parser', '.']
'--tag=${_GCR_DOMAIN}/$PROJECT_ID/tekton-parser', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/tekton-parser']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/tekton-parser']
waitFor: build
id: push

- # Deploy to Cloud Run
name: google/cloud-sdk
args: ['gcloud', 'run', 'deploy', 'tekton-parser',
'--image', 'gcr.io/$PROJECT_ID/tekton-parser',
'--image', '${_GCR_DOMAIN}/$PROJECT_ID/tekton-parser',
'--region', '${_REGION}',
'--platform', 'managed'
]
id: deploy
waitFor: push

images: [
'gcr.io/$PROJECT_ID/tekton-parser'
'${_GCR_DOMAIN}/$PROJECT_ID/tekton-parser'
]
5 changes: 3 additions & 2 deletions dashboard/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ steps:
- # Build grafana image
name: gcr.io/cloud-builders/docker:latest
args: ['build', '--tag',
'gcr.io/$PROJECT_ID/fourkeys-grafana-dashboard:${_TAG}', '.']
'${_GCR_DOMAIN}/$PROJECT_ID/fourkeys-grafana-dashboard:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/fourkeys-grafana-dashboard:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/fourkeys-grafana-dashboard:${_TAG}']
id: push

# Read more about substitutions
# https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values
substitutions:
_TAG: latest
_GCR_DOMAIN: gcr.io
7 changes: 4 additions & 3 deletions event-handler/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
steps:
- # Build event_handler image
name: gcr.io/cloud-builders/docker:latest
args: ['build', '--tag=gcr.io/$PROJECT_ID/event-handler:${_TAG}', '.']
args: ['build', '--tag=${_GCR_DOMAIN}/$PROJECT_ID/event-handler:${_TAG}', '.']
id: build

- # Push the container image to Container Registry
name: gcr.io/cloud-builders/docker
args: ['push', 'gcr.io/$PROJECT_ID/event-handler:${_TAG}']
args: ['push', '${_GCR_DOMAIN}/$PROJECT_ID/event-handler:${_TAG}']
waitFor: build
id: push

images: [
'gcr.io/$PROJECT_ID/event-handler:${_TAG}'
'${_GCR_DOMAIN}/$PROJECT_ID/event-handler:${_TAG}'
]
substitutions:
_TAG: latest
_GCR_DOMAIN: gcr.io
3 changes: 3 additions & 0 deletions setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ To deploy Four Keys with Terraform, you will first need:
gcloud builds submit event-handler --config=event-handler/cloudbuild.yaml --project $PROJECT_ID
```

> If you're restricted to using GCP services in certain regions you can override the use of gcr.io with a local domain like eu.gcr.io by adding `--substitutions=_GCR_DOMAIN=eu.gcr.io` to both gcloud builds commands above and any parsers (next step).
> You'll also need to add the relevant URLs as variables in your `terraform/example/terraform.tfvars` file.

1. Use Cloud Build to build and push containers to Google Container Registry for the parsers you plan to use. See the [`bq-workers`](../bq-workers/) for available options. GitHub for example:
```
gcloud builds submit bq-workers --config=bq-workers/parsers.cloudbuild.yaml --project $PROJECT_ID --substitutions=_SERVICE=github
Expand Down