mirror of
https://github.com/10h30/genesis-simple-sidebars.git
synced 2026-06-05 15:08:34 +09:00
ci: add git to s3 script and CircleCI config
This commit is contained in:
+61
-11
@@ -1,22 +1,72 @@
|
||||
version: 2.1
|
||||
|
||||
jobs:
|
||||
test:
|
||||
commands:
|
||||
install_dependencies:
|
||||
description: "Install development dependencies."
|
||||
steps:
|
||||
- run: composer install
|
||||
|
||||
executors:
|
||||
base:
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:latest
|
||||
working_directory: /tmp
|
||||
php_node:
|
||||
docker:
|
||||
- image: circleci/php:7.3.3-stretch-node-browsers
|
||||
working_directory: /tmp/src
|
||||
|
||||
jobs:
|
||||
checkout:
|
||||
executor: base
|
||||
steps:
|
||||
- checkout
|
||||
- prepare-environment
|
||||
- checkout:
|
||||
path: src
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- src
|
||||
|
||||
standards:
|
||||
executor: php_node
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: /tmp
|
||||
- install_dependencies
|
||||
- run: composer phpcs
|
||||
|
||||
commands:
|
||||
prepare-environment:
|
||||
description: "Install dependencies."
|
||||
steps:
|
||||
- run: composer install
|
||||
deploy_svn:
|
||||
executor: base
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: /tmp
|
||||
- run:
|
||||
command: |
|
||||
SLUG=grep 'Text Domain:' ./plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
||||
VERSION=grep 'Version:' ./plugin.php | awk -F: '{print $2}' | sed 's/^\s//'
|
||||
chmod +x ./svn-deploy.sh
|
||||
./svn-deploy.sh
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
check-wp-cs:
|
||||
check-standards:
|
||||
jobs:
|
||||
- test
|
||||
- checkout:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- standards:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
requires:
|
||||
- checkout
|
||||
- deploy_svn:
|
||||
requires:
|
||||
- checkout
|
||||
- standards
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
branches:
|
||||
only: master
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/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!';
|
||||
@@ -3,3 +3,4 @@
|
||||
.gitattributes
|
||||
.svnignore
|
||||
node_modules
|
||||
.circlci
|
||||
|
||||
Reference in New Issue
Block a user