From 54f67f18756b6f3cee5cd320245e9a649717a7be Mon Sep 17 00:00:00 2001 From: Michael Duve Date: Fri, 20 Dec 2019 11:16:11 +0100 Subject: [PATCH] refactor(publish-rollout): renaming settings BREAKING CHANGE: renamed 'path-to-dockerfile' to 'cwd-path-for-build' BREAKING CHANGE: removed 'rollout' and 'publish' jobs as they are unused --- src/examples/publish-image.yml | 14 ------ src/examples/rollout-image.yml | 17 ------- src/jobs/publish-and-rollout-image.yml | 8 ++-- src/jobs/publish-image.yml | 61 ------------------------- src/jobs/rollout-image.yml | 62 -------------------------- 5 files changed, 4 insertions(+), 158 deletions(-) delete mode 100644 src/examples/publish-image.yml delete mode 100644 src/examples/rollout-image.yml delete mode 100644 src/jobs/publish-image.yml delete mode 100644 src/jobs/rollout-image.yml diff --git a/src/examples/publish-image.yml b/src/examples/publish-image.yml deleted file mode 100644 index 16fd3a2..0000000 --- a/src/examples/publish-image.yml +++ /dev/null @@ -1,14 +0,0 @@ -description: | - "Logs into GCP, builds and publishes a Docker image. Can be used to parallelize deployments and - reduce deployment time after a manual approval step." -usage: - version: 2.1 - orbs: - gke: titel-media/gcp-gke@0.2.3 - workflows: - main: - jobs: - - build - - gke/publish-image: - image: orb-badge-server - tag: "2" diff --git a/src/examples/rollout-image.yml b/src/examples/rollout-image.yml deleted file mode 100644 index e51fb70..0000000 --- a/src/examples/rollout-image.yml +++ /dev/null @@ -1,17 +0,0 @@ -description: | - "Rolls out a published Docker image to a GKE cluster. Can be used to parallelize deployments and - reduce deployment time after a manual approval step." -usage: - version: 2.1 - orbs: - gke: titel-media/gcp-gke@0.2.3 - workflows: - main: - jobs: - - build - - gke/publish-image: - image: orb-badge-server - tag: "2" - - gke/rollout-image: - image: orb-badge-server - tag: "2" diff --git a/src/jobs/publish-and-rollout-image.yml b/src/jobs/publish-and-rollout-image.yml index b84ae2d..326be80 100644 --- a/src/jobs/publish-and-rollout-image.yml +++ b/src/jobs/publish-and-rollout-image.yml @@ -42,12 +42,12 @@ parameters: description: A docker image tag added after a successful image rollout type: string default: "$CIRCLE_BRANCH.stable" - path-to-dockerfile: - description: The relative path to the Dockerfile to use when building image + cwd-path-for-build: + description: The relative path from where docker will start the build of the image type: string default: "." dockerfile: - description: Name of dockerfile to use + description: Path and name of dockerfile to use type: string default: "Dockerfile" extra_build_args: @@ -70,7 +70,7 @@ steps: google-project-id: <> image: <> tag: << parameters.tag >> - path: <> + path: <> extra_build_args: <> - gcr/push-image: registry-url: <> diff --git a/src/jobs/publish-image.yml b/src/jobs/publish-image.yml deleted file mode 100644 index 6383b14..0000000 --- a/src/jobs/publish-image.yml +++ /dev/null @@ -1,61 +0,0 @@ -description: "Build and publish the image to the Google Container Registry." -machine: true -parameters: - gcloud-service-key: - description: The gcloud service key - type: env_var_name - default: GCLOUD_SERVICE_KEY - google-project-id: - description: The Google project ID to connect with via the gcloud CLI - type: env_var_name - default: GOOGLE_PROJECT_ID - google-compute-zone: - description: The Google compute zone to connect with via the gcloud CLI - type: env_var_name - default: GOOGLE_COMPUTE_ZONE - registry-url: - description: The GCR registry URL from ['', us, eu, asia].gcr.io - type: string - default: gcr.io - image: - description: A name for your docker image - type: string - tag: - description: A docker image tag - type: string - default: "latest" - path-to-dockerfile: - description: The relative path to the Dockerfile to use when building image - type: string - default: "." - dockerfile: - description: Name of dockerfile to use - type: string - default: "Dockerfile" - extra_build_args: - type: string - default: "" - description: > - Extra flags to pass to docker build. For examples, see - https://docs.docker.com/engine/reference/commandline/build -steps: - - checkout-submodule - - attach_workspace: - at: ./ - - gcr/gcr-auth: - google-project-id: <> - google-compute-zone: <> - - install - - gcr/build-image: - dockerfile: <> - registry-url: <> - google-project-id: <> - image: <> - tag: << parameters.tag >> - path: <> - extra_build_args: <> - - gcr/push-image: - registry-url: <> - google-project-id: <> - image: <> - tag: <> diff --git a/src/jobs/rollout-image.yml b/src/jobs/rollout-image.yml deleted file mode 100644 index 66b99fc..0000000 --- a/src/jobs/rollout-image.yml +++ /dev/null @@ -1,62 +0,0 @@ -description: "Update cluster with new Docker image." -machine: true -parameters: - cluster: - description: "The Kubernetes cluster name." - type: string - deployment: - description: "The Kubernetes deployment name." - type: string - namespace: - description: "The Kubernetes namespace name." - type: string - default: "default" - container: - description: "The Kubernetes container name." - type: string - gcloud-service-key: - description: The gcloud service key - type: env_var_name - default: GCLOUD_SERVICE_KEY - google-project-id: - description: The Google project ID to connect with via the gcloud CLI - type: env_var_name - default: GOOGLE_PROJECT_ID - google-compute-zone: - description: The Google compute zone to connect with via the gcloud CLI - type: env_var_name - default: GOOGLE_COMPUTE_ZONE - registry-url: - description: The GCR registry URL from ['', us, eu, asia].gcr.io - type: string - default: gcr.io - image: - description: A name for your docker image - type: string - tag: - description: A docker image tag - type: string - default: "latest" -steps: - - checkout-submodule - - gcr/gcr-auth: - google-project-id: <> - google-compute-zone: <> - - install - - get-cluster-credentials: - cluster: "<>" - - rollout-image: - deployment: "<>" - namespace: "<>" - container: "<>" - image: "<>/$<>/<>:<>" - - notify-datadog: - image: "<>:<>" - - notify-sentry: - version: "$CIRCLE_PROJECT_REPONAME:<>" - - notify-slack: - text: "Deployed *<>:<>* - - <$CIRCLE_BUILD_URL|Build> by: - - message: $GIT_COMMIT_DESC"