Skip to content

Commit a258a63

Browse files
authored
Merge pull request #39 from Codeinwp/development
Fixed wrong image regex. Fixed image compression. Added wraith.
2 parents 1617152 + bd10213 commit a258a63

29 files changed

+593
-116
lines changed

.distignore

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
.git
2-
.distignore
3-
.gitignore
4-
.travis.yml
5-
.jshintrc
6-
Gruntfile.js
7-
grunt
8-
phpcs.xml
9-
node_modules
10-
logs
11-
package.json
12-
npm-debug.log
13-
.codeclimate.yml
14-
.csslintrc
15-
.eslintignore
16-
.eslintrc
1+
.git
2+
.distignore
3+
.gitignore
4+
.travis.yml
5+
.jshintrc
6+
Gruntfile.js
7+
grunt
8+
phpcs.xml
9+
node_modules
10+
logs
11+
package.json
12+
bin
13+
tests
14+
phpunit.xml
15+
npm-debug.log
16+
dist
17+
artifact
18+
composer.json
19+
composer.lock

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.idea
2-
node_modules
3-
logs
1+
.idea
2+
node_modules
3+
logs
4+
dist
5+
artifact
6+
vendor
7+
composer.lock

.travis.yml

100755100644
Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,63 @@
1-
language: php
2-
3-
## PHP versions to test against
4-
php:
5-
- "7.0"
6-
- "5.6"
7-
- "5.5"
8-
- "5.4"
9-
- "5.3"
10-
- "5.2"
11-
sudo: false
12-
env:
13-
- WP_VERSION=master WP_MULTISITE=0
14-
install:
15-
- . $HOME/.nvm/nvm.sh
16-
- nvm install stable
17-
- nvm use stable
18-
- npm install
19-
- npm install grunt-cli -g
20-
before_script:
21-
## Install the wordpress latest version
22-
- export WP_DEVELOP_DIR=/tmp/wordpress/
23-
- mkdir -p $WP_DEVELOP_DIR
24-
- git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
25-
- plugin_slug=$(basename $(pwd))
26-
- plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug
27-
- cd ..
28-
- mv $plugin_slug $plugin_dir
29-
- cd $WP_DEVELOP_DIR
30-
- cp wp-tests-config-sample.php wp-tests-config.php
31-
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
32-
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
33-
- sed -i "s/yourpasswordhere//" wp-tests-config.php
34-
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
35-
36-
## install PHPCS and Wordpress standards
37-
- pear install pear/PHP_CodeSniffer
38-
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/master.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
39-
- phpenv rehash
40-
- phpcs --config-set installed_paths $WP_DEVELOP_DIR/wordpress-coding-standards
41-
- phpenv rehash
42-
- cd $plugin_dir
43-
addons:
44-
code_climate:
45-
repo_token: c63bb0fd56cca4099244e34c7ed09620d4ed89116436f3bd642af45cae4d86c6
46-
script:
47-
grunt travis
1+
language: php
2+
php:
3+
- "7.0"
4+
- "5.6"
5+
- "5.5"
6+
- "5.4"
7+
- "5.3"
8+
- "5.2"
9+
matrix:
10+
include:
11+
- php: "5.6"
12+
before_install: chmod +x bin/wraith.sh
13+
install: true
14+
before_script:
15+
env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
16+
script: ./bin/wraith.sh
17+
sudo: false
18+
branches:
19+
except:
20+
- "/^*-v[0-9]/"
21+
env:
22+
matrix:
23+
- WP_VERSION=latest WP_MULTISITE=0
24+
global:
25+
- MASTER_BRANCH=production UPSTREAM_REPO=Codeinwp/feedzy-rss-feeds STORE_URL=https://themeisle.com
26+
install:
27+
- chmod +x bin/install-dependencies.sh
28+
- ". ./bin/install-dependencies.sh"
29+
script:
30+
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then grunt travis; fi;
31+
before_deploy:
32+
- chmod +x bin/prepare-deploy.sh
33+
- ". ./bin/prepare-deploy.sh"
34+
deploy:
35+
- provider: s3
36+
access_key_id: "$AWS_ACCESS_KEY"
37+
secret_access_key: "$AWS_SECRET_KEY"
38+
bucket: "$AWS_BUCKET"
39+
skip_cleanup: true
40+
acl: public_read
41+
overwrite: true
42+
local-dir: artifact/
43+
upload-dir: "$AWS_PRODUCTS_FOLDER/$THEMEISLE_REPO/latest"
44+
on:
45+
branch: "$MASTER_BRANCH"
46+
repo: "$UPSTREAM_REPO"
47+
condition: $TRAVIS_PHP_VERSION = "7.0"
48+
- provider: s3
49+
access_key_id: "$AWS_ACCESS_KEY"
50+
secret_access_key: "$AWS_SECRET_KEY"
51+
bucket: "$AWS_BUCKET"
52+
skip_cleanup: true
53+
acl: public_read
54+
overwrite: true
55+
local-dir: artifact/
56+
upload-dir: "$AWS_PRODUCTS_FOLDER/$THEMEISLE_REPO/$THEMEISLE_VERSION"
57+
on:
58+
repo: "$UPSTREAM_REPO"
59+
branch: "$MASTER_BRANCH"
60+
condition: $TRAVIS_PHP_VERSION = "7.0"
61+
after_deploy:
62+
- chmod +x bin/deploy.sh
63+
- ". ./bin/deploy.sh"

bin/deploy.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
3+
# We run this just one time, for a first job from the buid and just at once after_deploy hook.
4+
if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then
5+
6+
# Flag the run in order to not be trigged again on the next after_deploy.
7+
export AFTER_DEPLOY_RUN=1;
8+
echo " Started deploy script. ";
9+
10+
# Setup git username and email.
11+
12+
git config user.name "selul"
13+
git config user.email ${GITHUB_EMAIL}
14+
git fetch
15+
16+
# Check if we already have a tag with this version.
17+
if ! git rev-parse "v$THEMEISLE_VERSION" >/dev/null 2>&1
18+
then
19+
20+
# Send changelog changes to git.
21+
git checkout $MASTER_BRANCH
22+
git add -v .
23+
24+
# We use [skip ci] in message to prevent this commit to trigger the build.
25+
git commit -a -m "[AUTO][skip ci] Updating changelog for v"$THEMEISLE_VERSION
26+
git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" HEAD:$MASTER_BRANCH
27+
28+
# Tag the new release.
29+
git tag -a "v$THEMEISLE_VERSION" -m "[AUTO] Release of $THEMEISLE_VERSION ";
30+
git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" --tags ;
31+
sleep 5;
32+
33+
# Sends the api call for creating the release.
34+
# We use this as the travis release provider does not offer any way
35+
# to set the body of the release.
36+
API_JSON='{"tag_name": "v'$THEMEISLE_VERSION'","target_commitish": "'$MASTER_BRANCH'","name": "v'$THEMEISLE_VERSION'","body": "'$CHANGES'","draft": false,"prerelease": false}';
37+
curl -s --data "$API_JSON" "https://api.github.com/repos/$UPSTREAM_REPO/releases?access_token="$GITHUB_TOKEN > /dev/null;
38+
fi
39+
# Send update to the store
40+
STORE_JSON='{"version": "'$THEMEISLE_VERSION'","id": "'$THEMEISLE_ID'","body": "'$CHANGES'"}';
41+
curl -s -H "Content-Type: application/json" -H "x-themeisle-auth: $THEMEISLE_AUTH" --data "$STORE_JSON" "$STORE_URL/wp-json/ti-endpoint/v1/update_changelog_new/" > /dev/null
42+
43+
# Send data to demo server.
44+
grunt sftp
45+
46+
# Upload to Wordpress SVN
47+
if [ ! -z "$WPORG_PASS" ]; then
48+
49+
svn co -q "http://svn.wp-plugins.org/$THEMEISLE_REPO" svn
50+
51+
# Copy new content to svn trunk.
52+
rsync -r -p --delete dist/* svn/trunk
53+
54+
# Create new SVN tag.
55+
mkdir -p svn/tags/$THEMEISLE_VERSION
56+
rsync -r -p dist/* svn/tags/$THEMEISLE_VERSION
57+
# Add new files to SVN
58+
svn stat svn | grep '^?' | awk '{print $2}' | xargs -I x svn add x@
59+
# Remove deleted files from SVN
60+
svn stat svn | grep '^!' | awk '{print $2}' | xargs -I x svn rm --force x@
61+
62+
svn stat svn
63+
64+
# Commit to SVN
65+
svn commit svn --no-auth-cache -m "Release v$THEMEISLE_VERSION" --username $WPORG_USER --password $WPORG_PASS
66+
# Remove svn dir.
67+
rm -fR svn
68+
69+
fi
70+
71+
fi;

bin/install-dependencies.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# We run this on PR or on push to MASTER_BRANCH.
4+
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || ( [ "$TRAVIS_EVENT_TYPE" == "push" ] && [ "$TRAVIS_REPO_SLUG" == "$UPSTREAM_REPO" ] && [ "$TRAVIS_BRANCH" == "$MASTER_BRANCH" ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ] ) ; then
5+
6+
. $HOME/.nvm/nvm.sh
7+
nvm install stable
8+
nvm use stable
9+
10+
npm install
11+
npm install grunt-cli -g
12+
13+
phpenv local 5.6
14+
15+
composer selfupdate 1.0.0 --no-interaction
16+
composer install --no-interaction
17+
phpenv local --unset
18+
19+
fi;
20+
# We dont install PHPCS if is not a PR.
21+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
22+
23+
# Install PHPCS.
24+
pear install pear/PHP_CodeSniffer
25+
26+
# Install WPCS standards.
27+
git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $HOME/wordpress-coding-standards
28+
phpenv rehash
29+
phpcs --config-set installed_paths $HOME/wordpress-coding-standards
30+
phpenv rehash
31+
32+
# Install wordpress for testing.
33+
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
34+
export PATH="$HOME/.composer/vendor/bin:$PATH"
35+
36+
# Use phpunit 5.7 as WP dont support 6.
37+
if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
38+
composer global require "phpunit/phpunit=5.7.*" ;
39+
fi;
40+
fi;

0 commit comments

Comments
 (0)