mirror of
https://github.com/10h30/genesis-simple-sidebars.git
synced 2026-06-05 15:08:34 +09:00
ci: deploy to WP Repo
ci: fix bug in bash scripting ci: remove manual approval job from tag deploy workflow ci: remove manual approval job from tag deploy workflow ci: circle config testig ci: fix svn_setup error ci: fix svn_setup error ci: split up svn commands for better error reporting ci: test svn_setup fix ci: svn_setup fix ci: debug working_directory ci: svn_setup fix maybe? ci: working_directory updates ci: working_directory updates ci: working_directory updates ci: working_directory updates ci: svn scripting is working
This commit is contained in:
+54
-36
@@ -5,51 +5,56 @@ commands:
|
|||||||
description: "Install development dependencies."
|
description: "Install development dependencies."
|
||||||
steps:
|
steps:
|
||||||
- run: composer install
|
- run: composer install
|
||||||
|
- show_pwd_info
|
||||||
|
|
||||||
mkdir_artifacts:
|
mkdir_artifacts:
|
||||||
description: "Make Artifacts directory"
|
description: "Make Artifacts directory"
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
[ ! -d "/tmp/artifacts" ] && mkdir /tmp/artifacts &>/dev/null
|
[ ! -d "/tmp/artifacts" ] && mkdir /tmp/artifacts &>/dev/null
|
||||||
|
|
||||||
|
set_verision_variable:
|
||||||
|
description: "Set the VERSION environment variable"
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
echo "export VERSION=$(grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//')" >> ${BASH_ENV}
|
||||||
|
|
||||||
|
show_pwd_info:
|
||||||
|
description: "Show information about the current directory"
|
||||||
|
steps:
|
||||||
|
- run: pwd
|
||||||
|
- run: ls -lash
|
||||||
|
|
||||||
svn_setup:
|
svn_setup:
|
||||||
description: "Setup SVN"
|
description: "Setup SVN"
|
||||||
steps:
|
steps:
|
||||||
- mkdir_artifacts
|
- run: echo "export SLUG=$(grep '@package' /tmp/src/plugin.php | awk -F ' ' '{print $3}' | sed 's/^\s//')" >> ${BASH_ENV}
|
||||||
- run:
|
- run: svn co https://plugins.svn.wordpress.org/${SLUG} --depth=empty .
|
||||||
command: |
|
- run: svn up trunk
|
||||||
cd /tmp/artifacts
|
- run: svn up tags --depth=empty
|
||||||
SLUG=grep 'Text Domain:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
- run: find ./trunk -not -path "./trunk" -delete
|
||||||
svn co https://plugins.svn.wordpress.org/$SLUG --depth=empty .
|
- run: cp -r /tmp/src/* ./trunk/.
|
||||||
svn up trunk
|
- run: svn propset svn:ignore -F /tmp/src/.svnignore ./trunk
|
||||||
svn up tags --depth=empty
|
|
||||||
cd trunk
|
|
||||||
rm -rf * .* *.*
|
|
||||||
cp -r /tmp/src/* .
|
|
||||||
svn propset svn:ignore -F .svnignore .
|
|
||||||
svn_add_changes:
|
svn_add_changes:
|
||||||
description: "Add changes to SVN"
|
description: "Add changes to SVN"
|
||||||
steps:
|
steps:
|
||||||
- deploy:
|
- run: svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm
|
||||||
command: |
|
- run: svn add --force .
|
||||||
cd /tmp/artifacts
|
|
||||||
svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm
|
|
||||||
svn add --force .
|
|
||||||
svn_create_tag:
|
svn_create_tag:
|
||||||
description: "Create a SVN tag"
|
description: "Create a SVN tag"
|
||||||
steps:
|
steps:
|
||||||
- deploy:
|
- set_verision_variable
|
||||||
command: |
|
- run: svn cp trunk tags/${VERSION}
|
||||||
cd /tmp/artifacts
|
|
||||||
VERSION=grep 'Version:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
|
||||||
svn cp trunk tags/$VERSION
|
|
||||||
svn_commit:
|
svn_commit:
|
||||||
description: "Commit changes to SVN"
|
description: "Commit changes to SVN"
|
||||||
steps:
|
steps:
|
||||||
- deploy:
|
- set_verision_variable
|
||||||
command: |
|
- run: svn ci -m "Tagging ${VERSION} from Github" --no-auth-cache --non-interactive --username "${SVN_USERNAME}" --password "${SVN_PASSWORD}"
|
||||||
cd /tmp/artifacts
|
|
||||||
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:
|
executors:
|
||||||
base:
|
base:
|
||||||
@@ -65,6 +70,7 @@ jobs:
|
|||||||
checkout:
|
checkout:
|
||||||
executor: base
|
executor: base
|
||||||
steps:
|
steps:
|
||||||
|
- mkdir_artifacts
|
||||||
- checkout:
|
- checkout:
|
||||||
path: src
|
path: src
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
@@ -74,6 +80,7 @@ jobs:
|
|||||||
|
|
||||||
checks:
|
checks:
|
||||||
executor: php_node
|
executor: php_node
|
||||||
|
working_directory: /tmp/src
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /tmp
|
at: /tmp
|
||||||
@@ -86,6 +93,7 @@ jobs:
|
|||||||
|
|
||||||
deploy_svn_branch:
|
deploy_svn_branch:
|
||||||
executor: base
|
executor: base
|
||||||
|
working_directory: /tmp/artifacts
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /tmp
|
at: /tmp
|
||||||
@@ -95,6 +103,7 @@ jobs:
|
|||||||
|
|
||||||
deploy_svn_tag:
|
deploy_svn_tag:
|
||||||
executor: base
|
executor: base
|
||||||
|
working_directory: /tmp/artifacts
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /tmp
|
at: /tmp
|
||||||
@@ -107,31 +116,41 @@ workflows:
|
|||||||
version: 2
|
version: 2
|
||||||
checks:
|
checks:
|
||||||
jobs:
|
jobs:
|
||||||
- checkout
|
- checkout:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- master
|
||||||
- checks:
|
- checks:
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
- checkout
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- master
|
||||||
|
|
||||||
branch_deploy:
|
branch_deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- checkout:
|
- checkout:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only:
|
||||||
|
- master
|
||||||
- checks:
|
- checks:
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
- checkout
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only:
|
||||||
|
- master
|
||||||
- deploy_svn_branch:
|
- deploy_svn_branch:
|
||||||
context: genesis-svn
|
context: genesis-svn
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
|
||||||
- checks
|
- checks
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
tag_deploy:
|
tag_deploy:
|
||||||
jobs:
|
jobs:
|
||||||
@@ -140,7 +159,7 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only: /^\d+\.\d+\.\d+$/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
branches:
|
branches:
|
||||||
only: master
|
ignore: /.*/
|
||||||
- checks:
|
- checks:
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -148,14 +167,13 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only: /^\d+\.\d+\.\d+$/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
branches:
|
branches:
|
||||||
only: master
|
ignore: /.*/
|
||||||
- deploy_svn_tag:
|
- deploy_svn_tag:
|
||||||
context: genesis-svn
|
context: genesis-svn
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
|
||||||
- checks
|
- checks
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^\d+\.\d+\.\d+$/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
branches:
|
branches:
|
||||||
only: master
|
ignore: /.*/
|
||||||
|
|||||||
Reference in New Issue
Block a user