mirror of
https://github.com/10h30/genesis-simple-sidebars.git
synced 2026-06-05 15:08:34 +09:00
ci: include all deploy scripting in config
This commit is contained in:
+104
-13
@@ -5,6 +5,54 @@ commands:
|
|||||||
description: "Install development dependencies."
|
description: "Install development dependencies."
|
||||||
steps:
|
steps:
|
||||||
- run: composer install
|
- run: composer install
|
||||||
|
mkdir_artifacts:
|
||||||
|
description: "Make Artifacts directory"
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
[ ! -d "/tmp/artifacts" ] && mkdir /tmp/artifacts &>/dev/null
|
||||||
|
svn_setup:
|
||||||
|
description: "Setup SVN"
|
||||||
|
parameters:
|
||||||
|
slug:
|
||||||
|
type: string
|
||||||
|
steps:
|
||||||
|
- mkdir_artifacts
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
cd /tmp/artifacts
|
||||||
|
SLUG=grep 'Text Domain:' /tmp/src/plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
||||||
|
svn co https://plugins.svn.wordpress.org/$SLUG --depth=empty .
|
||||||
|
svn up trunk
|
||||||
|
svn up tags --depth=empty
|
||||||
|
cd trunk
|
||||||
|
rm -rf * .* *.*
|
||||||
|
cp -r /tmp/src/* .
|
||||||
|
svn propset svn:ignore -F .svnignore .
|
||||||
|
svn_add_changes:
|
||||||
|
description: "Add changes to SVN"
|
||||||
|
steps:
|
||||||
|
- deply:
|
||||||
|
command: |
|
||||||
|
cd /tmp/artifacts
|
||||||
|
svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm
|
||||||
|
svn add --force .
|
||||||
|
svn_create_tag:
|
||||||
|
description: "Create a SVN tag"
|
||||||
|
steps:
|
||||||
|
- deploy:
|
||||||
|
command: |
|
||||||
|
cd /tmp/artifacts
|
||||||
|
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"
|
||||||
|
steps:
|
||||||
|
- deploy:
|
||||||
|
command: |
|
||||||
|
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:
|
||||||
@@ -27,46 +75,89 @@ jobs:
|
|||||||
paths:
|
paths:
|
||||||
- src
|
- src
|
||||||
|
|
||||||
standards:
|
checks:
|
||||||
executor: php_node
|
executor: php_node
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /tmp
|
at: /tmp
|
||||||
- install_dependencies
|
- install_dependencies
|
||||||
- run: composer phpcs
|
- run: composer phpcs
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: /tmp
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
|
||||||
deploy_svn:
|
deploy_svn_branch:
|
||||||
executor: base
|
executor: base
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /tmp
|
at: /tmp
|
||||||
- run:
|
- svn_setup
|
||||||
command: |
|
- svn_add_changes
|
||||||
SLUG=grep 'Text Domain:' ./plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
- svn_commit
|
||||||
VERSION=grep 'Version:' ./plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
|
||||||
chmod +x ./svn-deploy.sh
|
deploy_svn_tag:
|
||||||
./svn-deploy.sh
|
executor: base
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp
|
||||||
|
- svn_setup
|
||||||
|
- svn_add_changes
|
||||||
|
- svn_create_tag
|
||||||
|
- svn_commit
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
check-standards:
|
checks:
|
||||||
|
jobs:
|
||||||
|
- checkout
|
||||||
|
- checks:
|
||||||
|
requires:
|
||||||
|
- checkout
|
||||||
|
|
||||||
|
branch_deploy:
|
||||||
|
jobs:
|
||||||
|
- checkout:
|
||||||
|
filters:
|
||||||
|
branchs:
|
||||||
|
only: master
|
||||||
|
- checks:
|
||||||
|
requires:
|
||||||
|
- checkout
|
||||||
|
filters:
|
||||||
|
branchs:
|
||||||
|
only: master
|
||||||
|
- deploy_svn_branch:
|
||||||
|
requires:
|
||||||
|
- checkout
|
||||||
|
- checks
|
||||||
|
filters:
|
||||||
|
branchs:
|
||||||
|
only: master
|
||||||
|
|
||||||
|
tag_deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- checkout:
|
- checkout:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
- standards:
|
- standards:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
- checkout
|
||||||
- deploy_svn:
|
- deploy_svn_tag:
|
||||||
|
context: genesis-svn
|
||||||
requires:
|
requires:
|
||||||
- checkout
|
- checkout
|
||||||
- standards
|
- standards
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /^\d+\.\d+\.\d+$/
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
CURDIR=$(pwd);
|
|
||||||
TMPDIR=~/.plugin-release-script;
|
|
||||||
|
|
||||||
mkdir $TMPDIR;
|
|
||||||
cd $TMPDIR;
|
|
||||||
svn co https://plugins.svn.wordpress.org/$SLUG --depth=empty .;
|
|
||||||
svn up trunk
|
|
||||||
svn up tags --depth=empty
|
|
||||||
cd trunk;
|
|
||||||
rm -rf * .* *.*;
|
|
||||||
### Clone the repo at the specific version tag
|
|
||||||
git clone --branch $VERSION git@github.com:$SLUG.git --depth 1 .
|
|
||||||
### This is where you would run any build commands
|
|
||||||
svn propset svn:ignore -F .svnignore .;
|
|
||||||
cd ../;
|
|
||||||
svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm;
|
|
||||||
svn add --force .;
|
|
||||||
svn cp trunk tags/$VERSION;
|
|
||||||
svn ci -m "Tagging $VERSION from Github" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD";
|
|
||||||
cd $CURDIR;
|
|
||||||
rm -rf $TMPDIR;
|
|
||||||
echo 'Done!';
|
|
||||||
Reference in New Issue
Block a user