Skip to content

Commit 115cf1c

Browse files
committed
[circleci] Deploy
1 parent b004e05 commit 115cf1c

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

.circleci/config.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,9 @@ jobs:
66
working_directory: ~/aplazame
77
steps:
88
- checkout
9-
- restore_cache:
10-
keys:
11-
- v1-dependencies-{{ checksum "composer.json" }}
12-
- v1-dependencies-
139

1410
- run: composer install -n --prefer-dist
1511

16-
- save_cache:
17-
paths:
18-
- ./vendor
19-
key: v1-dependencies-{{ checksum "composer.json" }}
20-
2112
- run:
2213
name: Check Syntax
2314
command: make syntax.checker
@@ -26,7 +17,7 @@ jobs:
2617
name: CS
2718
command: make style
2819

29-
deploy:
20+
deploy_to_s3:
3021
machine:
3122
enabled: true
3223
working_directory: ~/aplazame
@@ -39,12 +30,49 @@ jobs:
3930
name: Deploy to S3 when release
4031
command: aws s3 sync aplazame.latest.zip s3://aplazame/modules/woocommerce/ --delete
4132

33+
deploy_to_wordpress:
34+
machine:
35+
enabled: true
36+
working_directory: ~/aplazame
37+
steps:
38+
- run:
39+
name: Install dependencies
40+
command: sudo apt install -y rsync
41+
42+
- run:
43+
name: Clone wordpress repository
44+
command: svn co https://plugins.svn.wordpress.org/aplazame svn
45+
46+
- run:
47+
name: Sync assets
48+
command: rsync -r -p assets/* svn/assets
49+
50+
- run:
51+
name: Sync trunk
52+
command: rsync -r -p plugin/* svn/trunk
53+
54+
- run:
55+
name: Tag release
56+
command: svn cp trunk tags/${CIRCLECI_TAG:1}
57+
58+
- run:
59+
name: Commit
60+
command: svn ci --no-auth-cache --username $WP_USERNAME --password $WP_PASSWORD svn -m "tagging version ${CIRCLECI_TAG:1}"
61+
4262
workflows:
4363
version: 2
4464
build-deploy:
4565
jobs:
4666
- build
47-
- deploy:
67+
- deploy_to_s3:
68+
requires:
69+
- build
70+
filters:
71+
branches:
72+
ignore: /.*/
73+
tags:
74+
only: /^v.*/
75+
- deploy_to_wordpress:
4876
requires:
4977
- build
5078
filters:

0 commit comments

Comments
 (0)