mirror of
https://github.com/10h30/genesis-simple-sidebars.git
synced 2026-06-05 15:08:34 +09:00
Use wp-svn orb for deployment
This commit is contained in:
+7
-153
@@ -1,63 +1,7 @@
|
|||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
orbs:
|
orbs:
|
||||||
wp-svn: studiopress/wp-svn@0.1
|
wp-svn: studiopress/wp-svn@0.2
|
||||||
|
|
||||||
commands:
|
|
||||||
install_dependencies:
|
|
||||||
description: "Install development dependencies."
|
|
||||||
steps:
|
|
||||||
- run: composer install
|
|
||||||
|
|
||||||
mkdir_artifacts:
|
|
||||||
description: "Make Artifacts directory"
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
[ ! -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:
|
|
||||||
description: "Setup SVN"
|
|
||||||
steps:
|
|
||||||
- run: echo "export SLUG=$(grep '@package' /tmp/src/plugin.php | awk -F ' ' '{print $3}' | sed 's/^\s//')" >> ${BASH_ENV}
|
|
||||||
- run: svn co https://plugins.svn.wordpress.org/${SLUG} --depth=empty .
|
|
||||||
- run: svn up trunk
|
|
||||||
- run: svn up tags --depth=empty
|
|
||||||
- run: find ./trunk -not -path "./trunk" -delete
|
|
||||||
- run: cp -r /tmp/src/. ./trunk
|
|
||||||
- run: svn propset svn:ignore -F ./trunk/.svnignore ./trunk
|
|
||||||
|
|
||||||
svn_add_changes:
|
|
||||||
description: "Add changes to SVN"
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: if [[ ! -z $(svn st | grep ^\!) ]]; then svn st | grep ^! | awk '{print " --force "$2}' | xargs -0r svn rm; fi
|
|
||||||
- run: svn add --force .
|
|
||||||
|
|
||||||
svn_create_tag:
|
|
||||||
description: "Create a SVN tag"
|
|
||||||
steps:
|
|
||||||
- set_verision_variable
|
|
||||||
- run: svn cp trunk tags/${VERSION}
|
|
||||||
|
|
||||||
svn_commit:
|
|
||||||
description: "Commit changes to SVN"
|
|
||||||
steps:
|
|
||||||
- set_verision_variable
|
|
||||||
- run: svn ci -m "Tagging ${VERSION} from Github" --no-auth-cache --non-interactive --username "${SVN_USERNAME}" --password "${SVN_PASSWORD}"
|
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
base:
|
base:
|
||||||
@@ -70,63 +14,18 @@ executors:
|
|||||||
working_directory: /tmp/src
|
working_directory: /tmp/src
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checkout:
|
|
||||||
executor: base
|
|
||||||
steps:
|
|
||||||
- mkdir_artifacts
|
|
||||||
- checkout:
|
|
||||||
path: src
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: /tmp
|
|
||||||
paths:
|
|
||||||
- src
|
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
executor: php_node
|
executor: php_node
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- checkout
|
||||||
at: /tmp
|
- run: composer install && composer phpcs
|
||||||
- install_dependencies
|
|
||||||
- run: composer phpcs
|
|
||||||
|
|
||||||
deploy_svn_branch:
|
|
||||||
executor: base
|
|
||||||
working_directory: /tmp/artifacts
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: /tmp
|
|
||||||
- svn_setup
|
|
||||||
- svn_add_changes
|
|
||||||
- svn_commit
|
|
||||||
|
|
||||||
deploy_svn_tag:
|
|
||||||
executor: base
|
|
||||||
working_directory: /tmp/artifacts
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: /tmp
|
|
||||||
- svn_setup
|
|
||||||
- svn_create_tag
|
|
||||||
- svn_add_changes
|
|
||||||
- svn_commit
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
test-deploy:
|
test-deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- checkout:
|
- checks
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- master
|
|
||||||
- checks:
|
|
||||||
requires:
|
|
||||||
- checkout
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- master
|
|
||||||
- approval-for-deploy-tested-up-to-bump:
|
- approval-for-deploy-tested-up-to-bump:
|
||||||
requires:
|
requires:
|
||||||
- checks
|
- checks
|
||||||
type: approval
|
type: approval
|
||||||
filters:
|
filters:
|
||||||
@@ -138,52 +37,7 @@ workflows:
|
|||||||
context: genesis-svn
|
context: genesis-svn
|
||||||
requires:
|
requires:
|
||||||
- approval-for-deploy-tested-up-to-bump
|
- approval-for-deploy-tested-up-to-bump
|
||||||
|
- wp-svn/deploy:
|
||||||
branch_deploy:
|
dry-run: true
|
||||||
jobs:
|
|
||||||
- checkout:
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- checks:
|
|
||||||
requires:
|
|
||||||
- checkout
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- deploy_svn_branch:
|
|
||||||
context: genesis-svn
|
|
||||||
requires:
|
requires:
|
||||||
- checks
|
- checks
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
tag_deploy:
|
|
||||||
jobs:
|
|
||||||
- checkout:
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /^\d+\.\d+\.\d+$/
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
- checks:
|
|
||||||
requires:
|
|
||||||
- checkout
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /^\d+\.\d+\.\d+$/
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
- deploy_svn_tag:
|
|
||||||
context: genesis-svn
|
|
||||||
requires:
|
|
||||||
- checks
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /^\d+\.\d+\.\d+$/
|
|
||||||
branches:
|
|
||||||
ignore: /.*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user