-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
sentry-release
deploy task
- Loading branch information
1 parent
ab36176
commit 4f06435
Showing
9 changed files
with
172 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
charts/tekton-pipelines/templates/buildpacks/pipelines/buildpack.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
charts/tekton-pipelines/templates/common/tasks/sentry-release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ if .Values.sentry.enabled }} | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: sentry-release | ||
namespace: {{ .Release.Namespace }} | ||
|
||
spec: | ||
description: >- | ||
The task prepares and deploys sentry release for projects, which exist in Sentry. | ||
params: | ||
- name: project | ||
type: string | ||
description: name of the project, which component is deployed | ||
- name: component | ||
type: string | ||
description: name of the application component, which is deployed | ||
- name: environment | ||
type: string | ||
description: environment name of the app being built, i.e. dev/staging/prod | ||
- name: source_subpath | ||
type: string | ||
description: a subpath within the `source` input where the source to build is located | ||
|
||
stepTemplate: | ||
env: | ||
- name: SENTRY_AUTH_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ .Values.sentry.authTokenSecret }} | ||
key: {{ .Values.sentry.authTokenSecretKey }} | ||
- name: SENTRY_ORG | ||
value: {{ .Values.sentry.org }} | ||
- name: SENTRY_URL | ||
value: {{ .Values.sentry.url }} | ||
|
||
steps: | ||
- name: release | ||
image: {{ .Values.images.sentry_cli }} | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
script: | | ||
#!/usr/bin/env bash | ||
set +x | ||
sentry-cli login | ||
PROJECT=$(sentry-cli projects list | awk -v col=4 '{print $col}' | grep ^$(params.project)-$(params.component)$) | ||
if [[ -z "${PROJECT}" ]]; then | ||
echo "Didn't find '$(params.project)-$(params.component)' project in Sentry. Skip this step." | ||
exit 0 | ||
fi | ||
VERSION=$(sentry-cli releases propose-version) | ||
sentry-cli releases new -p ${PROJECT} ${VERSION} | ||
sentry-cli releases set-commits --auto --ignore-missing -p ${PROJECT} ${VERSION} | ||
# needs to upload source maps for `frontend` projects | ||
if [[ $(context.pipeline.name) == {{ .Values.buildpacks.generate.buildpackFrontendBuildPipeline.name }} ]]; then | ||
echo "Upload source maps for `frontend` project" | ||
sentry-cli releases files -p ${PROJECT} ${VERSION} upload-sourcemaps $(params.source_subpath) | ||
fi | ||
sentry-cli releases deploys -p ${PROJECT} ${VERSION} new -e $(params.environment) | ||
sentry-cli releases finalize -p ${PROJECT} ${VERSION}'" | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters