-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add cloud deploy resources * boilerplate for deploy trigger * add dynamic steps to build trigger * use inline yaml for build trigger * use build service account for build trigger * use build_id for unique releases * rename trigger name from deploy to release * use short build ID for cloud deploy release name * rename new release build * use built-in subs instead of template vars * formatting * use built-in subs for build trigger too * use tftpl for config files * remove unused local block * update new release trigger to use local templates * chore: tf fmt * rename tftpl and tf fmt * update local vars * update yaml name to tftpl * update AR repo vars * require cloud deploy approval * rearrange resources and add comments * new lines * add env vars to app-prod tftpl * retrieve ip addr and pass var values * tf fmt * rm old clouddeploy module * update name of module in root * add clouddeploy api and delay * add additional apis * tf fmt * rename env directories * update README with pipeline instructions * correct regex * change src/* * replace provider --------- Co-authored-by: Roger Martinez <rogerthatdev@gmail.com>
- Loading branch information
1 parent
914e324
commit d734481
Showing
16 changed files
with
323 additions
and
335 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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: ${deployment_name} | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: app-image | ||
env: | ||
- name: NEXTAUTH_URL | ||
value: http://${lb_ip_address} | ||
- name: PROJECT_ID | ||
value: ${project_id} | ||
- name: NEXTAUTH_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
key: latest | ||
name: ${deployment_name}-nextauth-secret | ||
serviceAccountName: ${run_service_account} |
42 changes: 42 additions & 0 deletions
42
infra/modules/cicd/cloudbuild/new-release.cloudbuild.yaml.tftpl
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,42 @@ | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
steps: | ||
# Skaffold yaml | ||
- name: 'ubuntu' | ||
id: 'Skaffold yaml config' | ||
entrypoint: 'bash' | ||
args: | ||
- '-c' | ||
- | | ||
echo "$${_SKAFFOLD_CONFIG}" > /workspace/skaffold.yaml | ||
- name: 'ubuntu' | ||
id: 'Run yaml config' | ||
entrypoint: 'bash' | ||
args: | ||
- '-c' | ||
- | | ||
echo "$${_RUN_CONFIG}" > /workspace/app-prod.yaml | ||
- name: gcr.io/cloud-builders/gcloud | ||
id: 'Create new release on Cloud Deploy' | ||
entrypoint: 'bash' | ||
args: | ||
- '-c' | ||
- | | ||
gcloud deploy releases create app-release-$(echo $${BUILD_ID} | cut -f1 -d'-') \ | ||
--project=$${PROJECT_ID} \ | ||
--region=$${_REGION} \ | ||
--delivery-pipeline=$${_PIPELINE_NAME} \ | ||
--images=app-image=$${_IMAGE}:$${SHORT_SHA} | ||
|
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,11 @@ | ||
apiVersion: skaffold/v3alpha1 | ||
kind: Config | ||
metadata: | ||
name: ${name} | ||
profiles: | ||
- name: prod | ||
manifests: | ||
rawYaml: | ||
- app-prod.yaml | ||
deploy: | ||
cloudrun: {} |
Oops, something went wrong.