Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions gocd/templates/bash/check-github.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

checks-githubactions-checkruns \
getsentry/sentry-orbital \
"${GO_REVISION_ORBITAL_REPO}" \
"Build and smoke test"
9 changes: 9 additions & 0 deletions gocd/templates/bash/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

eval "$(regions-project-env-vars --region="${SENTRY_REGION}")"

/devinfra/scripts/get-cluster-credentials \
&& k8s-deploy \
--label-selector="service=orbital" \
--image="ghcr.io/getsentry/sentry-orbital:${GO_REVISION_ORBITAL_REPO}" \
--container-name="orbital"
15 changes: 15 additions & 0 deletions gocd/templates/jsonnetfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": 1,
"dependencies": [
{
"source": {
"git": {
"remote": "https://github.com/getsentry/gocd-jsonnet.git",
"subdir": "libs"
}
},
"version": "v2.19.0"
}
],
"legacyImports": true
}
16 changes: 16 additions & 0 deletions gocd/templates/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 1,
"dependencies": [
{
"source": {
"git": {
"remote": "https://github.com/getsentry/gocd-jsonnet.git",
"subdir": "libs"
}
},
"version": "56cc4d91cbaac4569b37b4911998b48c2f9c2ac4",
"sum": "J0D//go/146qfReWFTTL5xWWCVlkTjqhnALYPH4Z9rE="
}
],
"legacyImports": false
}
32 changes: 32 additions & 0 deletions gocd/templates/orbital.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local orbital = import './pipelines/orbital.libsonnet';
local pipedream = import 'github.com/getsentry/gocd-jsonnet/libs/pipedream.libsonnet';

local pipedream_config = {
name: 'orbital',
auto_deploy: true,
// US-only
exclude_regions: [
's4s',
's4s2',
'de',
'customer-1',
'customer-2',
'customer-4',
'customer-7',
],
materials: {
orbital_repo: {
git: 'git@github.com:getsentry/sentry-orbital.git',
shallow_clone: false,
branch: 'master',
destination: 'orbital',
},
},
rollback: {
material_name: 'orbital_repo',
stage: 'deploy-primary',
elastic_profile_id: 'orbital',
},
};

pipedream.render(pipedream_config, orbital)
49 changes: 49 additions & 0 deletions gocd/templates/pipelines/orbital.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
local gocdtasks = import 'github.com/getsentry/gocd-jsonnet/libs/gocd-tasks.libsonnet';

function(region) {
materials: {
orbital_repo: {
git: 'git@github.com:getsentry/sentry-orbital.git',
shallow_clone: false,
branch: 'master',
destination: 'orbital',
},
},
lock_behavior: 'unlockWhenFinished',
stages: [
{
checks: {
fetch_materials: true,
environment_variables: {
GITHUB_TOKEN: '{{SECRET:[devinfra-github][token]}}',
},
jobs: {
check: {
timeout: 1200,
elastic_profile_id: 'orbital',
tasks: [
gocdtasks.script(importstr '../bash/check-github.sh'),
],
},
},
},
},
{
'deploy-primary': {
fetch_materials: true,
environment_variables: {
SENTRY_REGION: region,
},
jobs: {
deploy: {
timeout: 1200,
elastic_profile_id: 'orbital',
tasks: [
gocdtasks.script(importstr '../bash/deploy.sh'),
],
},
},
},
},
],
}