forked from getsentry/sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
57 lines (51 loc) · 1.62 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
57 lines (51 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Cloud Build configuration for kencove/sentry
# Builds custom Sentry image with GitLab Autofix support
#
# Usage:
# gcloud builds submit --config=cloudbuild.yaml .
#
# Or with custom tag:
# gcloud builds submit --config=cloudbuild.yaml --substitutions=_TAG=v26.1.0-gitlab .
#
# Trigger on push:
# gcloud builds triggers create github \
# --repo-name=sentry --repo-owner=kencove \
# --branch-pattern="^master$" \
# --build-config=cloudbuild.yaml
substitutions:
_REGION: us-central1
_REPOSITORY: kencove-docker-repo
_IMAGE_NAME: sentry
_TAG: ${COMMIT_SHA}
options:
machineType: E2_HIGHCPU_32
diskSizeGb: 200
logging: CLOUD_LOGGING_ONLY
steps:
# Build using multi-stage Dockerfile that handles both frontend and runtime
- name: 'gcr.io/cloud-builders/docker'
id: 'build-image'
args:
- 'build'
- '-t'
- '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:${_TAG}'
- '-t'
- '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:latest'
- '-f'
- 'self-hosted/Dockerfile.kencove'
- '--build-arg'
- 'SOURCE_COMMIT=${COMMIT_SHA}'
- '--progress=plain'
- '.'
# Push to Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
id: 'push-image'
args:
- 'push'
- '--all-tags'
- '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}'
waitFor: ['build-image']
images:
- '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:${_TAG}'
- '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:latest'
timeout: 3600s # 1 hour - Sentry build is slow