use github action instead of script to run new builds
parent
ee83bb263d
commit
58ab39439e
@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
set -u
|
||||
|
||||
VERBOSE="${VERBOSE:-0}"
|
||||
if [[ "${VERBOSE}" -ne "0" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# List of required environment variables
|
||||
required_vars=(
|
||||
"GCLOUD_API_KEY"
|
||||
"GCLOUD_PROD_DEPLOY_SECRET"
|
||||
"GCLOUD_DEV_DEPLOY_SECRET"
|
||||
)
|
||||
|
||||
# Check if each required variable is set
|
||||
for var in "${required_vars[@]}"; do
|
||||
if [[ -z "${!var:-}" ]]; then
|
||||
echo "Error: Environment variable '$var' is not set."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Trigger a build for dev
|
||||
# DONT EVER SET ANY FLAGS THAT MIGHT PRINT THE URL, AS IT HAS SECRETS IN IT
|
||||
curl -X POST "https://cloudbuild.googleapis.com/v1/projects/coder-registry-1/triggers/http-build-registry-v2-dev:webhook?key=${GCLOUD_API_KEY}&secret=${GCLOUD_DEV_DEPLOY_SECRET}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{}' \
|
||||
--fail
|
||||
|
||||
# Trigger a build for prod
|
||||
# DONT EVER SET ANY FLAGS THAT MIGHT PRINT THE URL, AS IT HAS SECRETS IN IT
|
||||
curl -X POST "https://cloudbuild.googleapis.com/v1/projects/coder-registry-1/triggers/http-build-registry-v2-trigger:webhook?key=${GCLOUD_API_KEY}&secret=${GCLOUD_PROD_DEPLOY_SECRET}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{}' \
|
||||
--fail
|
@ -1,4 +1,7 @@
|
||||
.terraform*
|
||||
node_modules
|
||||
*.tfstate
|
||||
*.tfstate.lock.info
|
||||
*.tfstate.lock.info
|
||||
|
||||
# Ignore generated credentials from google-github-actions/auth
|
||||
gha-creds-*.json
|
Loading…
Reference in New Issue