From 854545de3960cfbb752ee909826d6e2d274097e9 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Thu, 21 Nov 2024 16:31:54 +0000 Subject: [PATCH] feat(cloudsmith): move cloudsmith CircleCI config into plugin Tool Kit will be able to merge the additional custom CircleCI config into the configuration already defined by the circleci-deploy plugin. This will allow users to explicitly opt into the cloudsmith logic by installing the plugin, and compartmentalises the configuration. --- package-lock.json | 1 - plugins/circleci-deploy/.toolkitrc.yml | 17 ------------ plugins/circleci-deploy/package.json | 1 - plugins/cloudsmith/.toolkitrc.yml | 36 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index e833bf6d7..19165713b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30605,7 +30605,6 @@ "license": "ISC", "dependencies": { "@dotcom-tool-kit/circleci": "^7.0.2", - "@dotcom-tool-kit/cloudsmith": "^0.1.0", "tslib": "^2.3.1" }, "devDependencies": { diff --git a/plugins/circleci-deploy/.toolkitrc.yml b/plugins/circleci-deploy/.toolkitrc.yml index 8c9b04f4e..2461ad1d7 100644 --- a/plugins/circleci-deploy/.toolkitrc.yml +++ b/plugins/circleci-deploy/.toolkitrc.yml @@ -1,6 +1,5 @@ plugins: - '@dotcom-tool-kit/circleci' - - '@dotcom-tool-kit/cloudsmith' options: hooks: @@ -31,10 +30,6 @@ options: !toolkit/if-defined '@dotcom-tool-kit/serverless.awsAccountId': aws-account-id: !toolkit/option '@dotcom-tool-kit/serverless.awsAccountId' system-code: !toolkit/option '@dotcom-tool-kit/serverless.systemCode' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': - cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': - cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' - name: 'deploy-staging' requires: - 'setup' @@ -44,10 +39,6 @@ options: filters: branches: only: main - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': - cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': - cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' - name: 'e2e-test-review' requires: - 'deploy-review' @@ -80,10 +71,6 @@ options: !toolkit/if-defined '@dotcom-tool-kit/serverless.awsAccountId': aws-account-id: !toolkit/option '@dotcom-tool-kit/serverless.awsAccountId' system-code: !toolkit/option '@dotcom-tool-kit/serverless.systemCode' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': - cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': - cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' - name: 'nightly' jobs: - name: 'deploy-review' @@ -98,10 +85,6 @@ options: !toolkit/if-defined '@dotcom-tool-kit/serverless.awsAccountId': aws-account-id: !toolkit/option '@dotcom-tool-kit/serverless.awsAccountId' system-code: !toolkit/option '@dotcom-tool-kit/serverless.systemCode' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': - cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' - !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': - cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' !toolkit/if-defined '@dotcom-tool-kit/circleci.cypressImage': executors: - name: cypress diff --git a/plugins/circleci-deploy/package.json b/plugins/circleci-deploy/package.json index b7476a91f..2908f7342 100644 --- a/plugins/circleci-deploy/package.json +++ b/plugins/circleci-deploy/package.json @@ -11,7 +11,6 @@ "license": "ISC", "dependencies": { "@dotcom-tool-kit/circleci": "^7.0.2", - "@dotcom-tool-kit/cloudsmith": "^0.1.0", "tslib": "^2.3.1" }, "repository": { diff --git a/plugins/cloudsmith/.toolkitrc.yml b/plugins/cloudsmith/.toolkitrc.yml index 22817d2a9..d1ab236b3 100644 --- a/plugins/cloudsmith/.toolkitrc.yml +++ b/plugins/cloudsmith/.toolkitrc.yml @@ -1 +1,37 @@ version: 2 + +plugins: + - '@dotcom-tool-kit/circleci-deploy' + +options: + hooks: + - CircleCi: + workflows: + - name: 'tool-kit' + jobs: + - name: 'deploy-review' + custom: + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': + cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': + cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' + - name: 'deploy-staging' + custom: + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': + cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': + cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' + - name: 'deploy-production' + custom: + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': + cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': + cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount' + - name: 'nightly' + jobs: + - name: 'deploy-review' + custom: + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.organisation': + cloudsmith-org: !toolkit/option '@dotcom-tool-kit/cloudsmith.organisation' + !toolkit/if-defined '@dotcom-tool-kit/cloudsmith.serviceAccount': + cloudsmith-service-account: !toolkit/option '@dotcom-tool-kit/cloudsmith.serviceAccount'