-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
69 lines (65 loc) · 2.27 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
kind: pipeline
name: default
steps:
# Check that the version number has been updated everywhere, and that a
# changelog entry is present for the current version.
- name: validate
image: alpine
commands:
- apk -U add pcre2-tools perl
- CCFIC_VERSION=$(perl -pe '($_)=/Version:\s([0-9]+([.][0-9]+)+)/' featured-image-caption.php)
- pcre2grep -q "^define\(\s?'CCFIC_VERSION',\s?'$CCFIC_VERSION'\s?\)\;.*$" featured-image-caption.php
- pcre2grep -q "^Stable tag\:\s$CCFIC_VERSION$" readme.txt
- pcre2grep -Mq "^==\s?Changelog\s?==\s*=\s?$CCFIC_VERSION\s?=$" readme.txt
when:
event:
- tag
- name: test
image: unleashed/php:ci
environment:
WP_VERSION: latest
WP_MULTISITE: 0
DB_NAME: wordpress
DB_USER: wordpress
DB_PASS: wordpress
DB_HOSTNAME: mysql
SKIP_DB_CREATE: true
commands:
- mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini
- apt-get update && apt-get -y --no-install-recommends install subversion mariadb-client
- composer install
- sleep 10
- bash ./bin/install-wp-tests.sh $DB_NAME $DB_USER $DB_PASS $DB_HOSTNAME $WP_VERSION $SKIP_DB_CREATE
- ./vendor/bin/phpunit
- name: publish
image: alpine
environment:
WP_USERNAME:
from_secret: wp_repo_username
WP_PASSWORD:
from_secret: wp_repo_password
commands:
- apk -U add git perl subversion
- CCFIC_VERSION=$(perl -pe '($_)=/Version:\s([0-9]+([.][0-9]+)+)/' featured-image-caption.php)
- svn co https://plugins.svn.wordpress.org/featured-image-caption /svn
- (cd /svn && svn delete /svn/trunk/*)
- if [ -d "/svn/tags/$CCFIC_VERSION" ]; then rm -rf /svn/tags/$CCFIC_VERSION; fi
- cp featured-image-caption.php /svn/trunk/
- cp -r classes/ /svn/trunk/
- cp readme.txt /svn/trunk/
- cd /svn
- svn add trunk/*
- svn cp trunk tags/$CCFIC_VERSION
- svn status
- svn ci -m "Version $CCFIC_VERSION" --username $WP_USERNAME --password $WP_PASSWORD --no-auth-cache
when:
event:
- tag
services:
- name: mysql
image: mariadb
environment:
MYSQL_RANDOM_ROOT_PASSWORD: yes
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress