From 0933a3007dd42597988105fd5a70f5980c95fe41 Mon Sep 17 00:00:00 2001 From: Ben Moore Date: Mon, 6 Apr 2020 09:52:16 -0500 Subject: [PATCH 1/5] ci: include extra protections against tags in other branches --- .circleci/config.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a4f94f1..4ef8ac5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ commands: - run: command: | cd /tmp/artifacts - SLUG=grep 'Text Domain:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//' + SLUG=$(grep '@package' /tmp/src/plugin.php | awk -F ' ' '{print $3}' | sed 's/^\s//') svn co https://plugins.svn.wordpress.org/$SLUG --depth=empty . svn up trunk svn up tags --depth=empty @@ -127,7 +127,6 @@ workflows: - deploy_svn_branch: context: genesis-svn requires: - - checkout - checks filters: branches: @@ -140,7 +139,7 @@ workflows: tags: only: /^\d+\.\d+\.\d+$/ branches: - only: master + ignore: /.*/ - checks: requires: - checkout @@ -148,14 +147,22 @@ workflows: tags: only: /^\d+\.\d+\.\d+$/ branches: - only: master - - deploy_svn_tag: - context: genesis-svn + ignore: /.*/ + - hold: + type: approval requires: - - checkout - checks filters: tags: only: /^\d+\.\d+\.\d+$/ branches: - only: master + ignore: /.*/ + - deploy_svn_tag: + context: genesis-svn + requires: + - hold + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ From 4f8ea7a7ec9b6d3719ed641c6bc947f18c16f5ad Mon Sep 17 00:00:00 2001 From: Ben Moore Date: Mon, 6 Apr 2020 11:06:07 -0500 Subject: [PATCH 2/5] ci: fix bug in bash scripting --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ef8ac5..5df5b38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ commands: - deploy: command: | cd /tmp/artifacts - VERSION=grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//' + VERSION=$(grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//') svn cp trunk tags/$VERSION svn_commit: description: "Commit changes to SVN" @@ -48,7 +48,7 @@ commands: - deploy: command: | cd /tmp/artifacts - VERSION=grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//' + VERSION=$(grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//') svn ci -m "Tagging $VERSION from Github" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" executors: From 4f5e53d36eed8f19a2b45754f702e70331cdc8ab Mon Sep 17 00:00:00 2001 From: Ben Moore Date: Wed, 8 Apr 2020 12:47:01 -0500 Subject: [PATCH 3/5] ci: remove manual approval job from tag deploy workflow --- .circleci/config.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5df5b38..361e076 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,15 +148,6 @@ workflows: only: /^\d+\.\d+\.\d+$/ branches: ignore: /.*/ - - hold: - type: approval - requires: - - checks - filters: - tags: - only: /^\d+\.\d+\.\d+$/ - branches: - ignore: /.*/ - deploy_svn_tag: context: genesis-svn requires: From c93f511288ee1edde14b7d1def9b1e6a9442306c Mon Sep 17 00:00:00 2001 From: Ben Moore Date: Wed, 8 Apr 2020 12:48:40 -0500 Subject: [PATCH 4/5] ci: remove manual approval job from tag deploy workflow --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 361e076..6010d1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -151,7 +151,7 @@ workflows: - deploy_svn_tag: context: genesis-svn requires: - - hold + - checks filters: tags: only: /^\d+\.\d+\.\d+$/ From edec87910b2ed3cf812e6c124564921f956fc2f2 Mon Sep 17 00:00:00 2001 From: Ben Moore Date: Wed, 8 Apr 2020 14:41:13 -0500 Subject: [PATCH 5/5] ci: circle config testig --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6010d1e..53e75e2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,10 +107,16 @@ workflows: version: 2 checks: jobs: - - checkout + - checkout: + filters: + branches: + ignore: master - checks: requires: - checkout + filters: + branches: + ignore: master branch_deploy: jobs: