Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gcloud): delete deploy-cloud-run #141

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
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
128 changes: 0 additions & 128 deletions gcloud/orb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,134 +370,6 @@ jobs:
gcloud functions deploy <<parameters.funcname>> --source="/tmp/build" \
<<parameters.flags>>

deploy-cloud-run:
description: >
Deploy a container to either Google's managed Cloud Run service or to a
specified Knative cluster.
executor: <<parameters.executor>>
parameters:
creds:
default: GCLOUD_SERVICE_KEY
description: >
Name of environment variable storing the base64-encoded service key
for the GCP project.
type: env_var_name
cluster:
default: ''
description: >
If set, deploys to a Knative cluster rather than using the managed
Cloud Run service.
type: string
cpu:
default: '1'
description: >
CPU to be allocated to our cloud run container.
type: string
deployment:
description: >
Name of deployment to-be-updated.
type: string
# TODO: Find a better way to do this. CircleCI does not have a list
# type yet: https://ideas.circleci.com/ideas/CCI-I-701
env_vars:
default: ''
description: >
Evironment variables to be passed into the cloud run container.
type: string
executor:
default: gcloud-alpine-latest
description: >
Executor for the job. Must have a working gcloud version installed.
To use your own custom executor, see
`https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors`.
Defaults to a small google/cloud-sdk:alpine docker image.
type: executor
image:
default: ${CIRCLE_PROJECT_REPONAME}
description: >
Name of the target image. Note that this will be prepended by the
project name (eg. <<parameters.project>>), so the full path your
image will be pushed to will look like:
<<parameters.registry>>/<<parameters.project>>/<<parameters.image>>.
type: string
managed_flags:
description: >
Flags to pass to the `gcloud run deploy` command. Will only be used
for managed deploys (eg. Cloud Run rather than Knative).
default: --no-allow-unauthenticated
type: string
memory:
description: >
Memory to be allocated to our cloud run container, measured in Mi.
default: 128Mi
type: string
project:
description: >
Name of GCP project to which we will push.
type: string
region:
description: >
Name of GCP region to which we will push.
type: string
steps:
- auth:
creds: <<parameters.creds>>
project: <<parameters.project>>
- unless:
condition: <<parameters.cluster>>
steps:
- unless:
condition: <<parameters.env_vars>>
steps:
- run: |
gcloud run deploy <<parameters.deployment>> \
--platform=managed <<parameters.managed_flags>> \
--image="gcr.io/<<parameters.project>>/<<parameters.image>>:${CIRCLE_SHA1:0:10}" \
--cpu=<<parameters.cpu>> \
--memory=<<parameters.memory>> \
--region=<<parameters.region>> \
--clear-env-vars &> output
- when:
condition: <<parameters.env_vars>>
steps:
- run: |
gcloud run deploy <<parameters.deployment>> \
--platform=managed <<parameters.managed_flags>> \
--image="gcr.io/<<parameters.project>>/<<parameters.image>>:${CIRCLE_SHA1:0:10}" \
--cpu=<<parameters.cpu>> \
--memory=<<parameters.memory>> \
--region=<<parameters.region>> \
--set-env-vars <<parameters.env_vars>> &> output
- run: |
gcloud run services update-traffic <<parameters.deployment>> \
--platform=managed \
--region=<<parameters.region>> \
--to-latest
- when:
condition: <<parameters.cluster>>
steps:
- run: |
gcloud run deploy <<parameters.deployment>> \
--platform=gke \
--image "gcr.io/<<parameters.project>>/<<parameters.image>>:${CIRCLE_SHA1:0:10}" \
--cpu=<<parameters.cpu>> \
--memory=<<parameters.memory>> \
--cluster=<<parameters.cluster>> \
--cluster-location=<<parameters.region>> \
--namespace=<<parameters.project>> \
--set-env-vars <<parameters.env_vars>> &> output
- run: |
gcloud run services update-traffic <<parameters.deployment>> \
--platform=gke \
--cluster=<<parameters.cluster>> \
--cluster-location=<<parameters.region>> \
--namespace=<<parameters.project>> \
--to-latest
- run:
name: cat output
command: cat output
when: always

deploy-gke:
description: >
Deploy a k8s deployment to GKE via provided YAML. Will record the
Expand Down
Loading