From 6d70630b156e358cea1cf08fce79407caf3c2480 Mon Sep 17 00:00:00 2001 From: "circleci-app[bot]" <127350680+circleci-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 06:41:49 +0000 Subject: [PATCH] CircleCI Commit --- .circleci/rollback.yml | 75 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .circleci/rollback.yml diff --git a/.circleci/rollback.yml b/.circleci/rollback.yml new file mode 100644 index 000000000..d8539feff --- /dev/null +++ b/.circleci/rollback.yml @@ -0,0 +1,75 @@ +# This is a template CircleCI rollback config +# that shows how to use deploy markers to track deployments. +# You can edit this template to add your custom rollback logic. + +version: 2.1 + +jobs: + rollback-component: + docker: + - image: cimg/base:current + environment: + COMPONENT_NAME: << pipeline.deploy.component_name >> + NAMESPACE: << pipeline.deploy.namespace >> + ENVIRONMENT_NAME: << pipeline.deploy.environment_name >> + TARGET_VERSION: << pipeline.deploy.target_version >> + steps: + - checkout + - attach_workspace: + at: . + + # This step will create a new deploy with PENDING status + # that will show up in the deploys tab in the UI + - run: + name: Plan release of deploy release smoke test + command: | + circleci run release plan \ + --environment-name=${ENVIRONMENT_NAME} \ + --namespace=${NAMESPACE} \ + --component-name=${COMPONENT_NAME} \ + --target-version=${TARGET_VERSION} \ + --rollback + + - run: + name: Perform rollback + command: + # Add here your custom logic to perform the rollback + + # These last two steps update the PENDING deployment marker + # to SUCCESS or FAILED, based on the outcome of the job. + - run: + name: Update planned release to SUCCESS + command: | + circleci run release update \ + --status=SUCCESS + when: on_success + - run: + name: Update planned release to FAILED + command: | + circleci run release update \ + --status=FAILED \ + when: on_fail + + # This job handles the cancellation of the rollback deploy marker + # if the rollback job is canceled + cancel-rollback: + docker: + - image: cimg/base:current + steps: + - run: + name: Update planned release to CANCELED + command: | + circleci run release update \ + --status=CANCELED + +workflows: + rollback: + jobs: + - rollback-component + - cancel-rollback: + requires: + - rollback-component: + - canceled + filters: + branches: + only: main