This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AUTO][skip ci] Updating changelog for v1.2.1
- Loading branch information
Showing
36 changed files
with
6,337 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
|
||
### v1.2.1 - 2017-05-08 | ||
**Changes:** | ||
- Update version | ||
|
||
### 1.2.0 - 06/04/2017 | ||
**Changes:** | ||
- Update readme.txt | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
# We run this just one time, for a first job from the buid and just at once after_deploy hook. | ||
if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then | ||
|
||
# Flag the run in order to not be trigged again on the next after_deploy. | ||
export AFTER_DEPLOY_RUN=1; | ||
echo " Started deploy script. "; | ||
|
||
# Setup git username and email. | ||
|
||
git config user.name "selul" | ||
git config user.email ${GITHUB_EMAIL} | ||
git fetch | ||
|
||
# Check if we already have a tag with this version. | ||
if ! git rev-parse "v$THEMEISLE_VERSION" >/dev/null 2>&1 | ||
then | ||
|
||
# Send changelog changes to git. | ||
git checkout $MASTER_BRANCH | ||
git add -v . | ||
|
||
# We use [skip ci] in message to prevent this commit to trigger the build. | ||
git commit -a -m "[AUTO][skip ci] Updating changelog for v"$THEMEISLE_VERSION | ||
git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" HEAD:$MASTER_BRANCH | ||
|
||
# Tag the new release. | ||
git tag -a "v$THEMEISLE_VERSION" -m "[AUTO] Release of $THEMEISLE_VERSION "; | ||
git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" --tags ; | ||
sleep 5; | ||
|
||
# Sends the api call for creating the release. | ||
# We use this as the travis release provider does not offer any way | ||
# to set the body of the release. | ||
API_JSON='{"tag_name": "v'$THEMEISLE_VERSION'","target_commitish": "'$MASTER_BRANCH'","name": "v'$THEMEISLE_VERSION'","body": "'$CHANGES'","draft": false,"prerelease": false}'; | ||
curl -s --data "$API_JSON" "https://api.github.com/repos/$UPSTREAM_REPO/releases?access_token="$GITHUB_TOKEN > /dev/null; | ||
fi | ||
# Send update to the store | ||
STORE_JSON='{"version": "'$THEMEISLE_VERSION'","id": "'$THEMEISLE_ID'","body": "'$CHANGES'"}'; | ||
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 | ||
|
||
# Send data to demo server. | ||
grunt sftp | ||
|
||
# Upload to Wordpress SVN | ||
if [ ! -z "$WPORG_PASS" ]; then | ||
|
||
svn co -q "http://svn.wp-plugins.org/$THEMEISLE_REPO" svn | ||
|
||
# Copy new content to svn trunk. | ||
rsync -r -p --delete --exclude=".*" dist/* svn/trunk | ||
|
||
# Create new SVN tag. | ||
mkdir -p svn/tags/$THEMEISLE_VERSION | ||
rsync -r -p dist/* svn/tags/$THEMEISLE_VERSION | ||
# Add new files to SVN | ||
svn stat svn | grep '^?' | awk '{print $2}' | xargs -I x svn add x@ | ||
# Remove deleted files from SVN | ||
svn stat svn | grep '^!' | awk '{print $2}' | xargs -I x svn rm --force x@ | ||
|
||
svn stat svn | ||
|
||
# Commit to SVN | ||
svn commit svn --no-auth-cache -m "Release v$THEMEISLE_VERSION" --username $WPORG_USER --password $WPORG_PASS | ||
# Remove svn dir. | ||
rm -fR svn | ||
|
||
fi | ||
|
||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# We run this on PR or on push to MASTER_BRANCH. | ||
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || ( [ "$TRAVIS_EVENT_TYPE" == "push" ] && [ "$TRAVIS_REPO_SLUG" == "$UPSTREAM_REPO" ] && [ "$TRAVIS_BRANCH" == "$MASTER_BRANCH" ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ] ) ; then | ||
|
||
. $HOME/.nvm/nvm.sh | ||
nvm install stable | ||
nvm use stable | ||
|
||
npm install | ||
npm install grunt-cli -g | ||
|
||
phpenv local 5.6 | ||
|
||
composer selfupdate 1.0.0 --no-interaction | ||
composer install --no-interaction | ||
phpenv local --unset | ||
|
||
fi; | ||
# We dont install PHPCS if is not a PR. | ||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then | ||
|
||
# Install PHPCS. | ||
pear install pear/PHP_CodeSniffer-2.8.1 | ||
|
||
# Install WPCS standards. | ||
git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $HOME/wordpress-coding-standards | ||
phpenv rehash | ||
phpcs --config-set installed_paths $HOME/wordpress-coding-standards | ||
phpenv rehash | ||
|
||
# Install wordpress for testing. | ||
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION | ||
export PATH="$HOME/.composer/vendor/bin:$PATH" | ||
|
||
# Use phpunit 5.7 as WP dont support 6. | ||
if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then | ||
composer global require "phpunit/phpunit=5.7.*" ; | ||
fi; | ||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
if [ $# -lt 3 ]; then | ||
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [force download]" | ||
exit 1 | ||
fi | ||
|
||
DB_NAME=$1 | ||
DB_USER=$2 | ||
DB_PASS=$3 | ||
DB_HOST=${4-localhost} | ||
WP_VERSION=${5-latest} | ||
FORCE=${6-false} | ||
|
||
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} | ||
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} | ||
|
||
download() { | ||
if [ `which curl` ]; then | ||
curl -s "$1" > "$2"; | ||
elif [ `which wget` ]; then | ||
wget -nv -O "$2" "$1" | ||
fi | ||
} | ||
|
||
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then | ||
WP_TESTS_TAG="tags/$WP_VERSION" | ||
else | ||
# http serves a single offer, whereas https serves multiple. we only want one | ||
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json | ||
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json | ||
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') | ||
if [[ -z "$LATEST_VERSION" ]]; then | ||
echo "Latest WordPress version could not be found" | ||
exit 1 | ||
fi | ||
WP_TESTS_TAG="tags/$LATEST_VERSION" | ||
fi | ||
|
||
if [[ $WP_TESTS_TAG == *"beta"* ]] | ||
then | ||
WP_TESTS_TAG="trunk" | ||
fi | ||
|
||
set -ex | ||
|
||
install_wp() { | ||
if [ $FORCE == 'true' ]; then | ||
rm -Rf $WP_CORE_DIR | ||
fi | ||
|
||
if [ -d $WP_CORE_DIR ]; then | ||
return; | ||
fi | ||
|
||
mkdir -p $WP_CORE_DIR | ||
|
||
if [ $WP_VERSION == 'latest' ]; then | ||
local ARCHIVE_NAME='latest' | ||
else | ||
local ARCHIVE_NAME="wordpress-$WP_VERSION" | ||
fi | ||
|
||
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz | ||
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR | ||
|
||
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php | ||
} | ||
|
||
install_test_suite() { | ||
if [ $FORCE == 'true' ]; then | ||
rm -Rf $WP_TESTS_DIR | ||
fi | ||
|
||
# portable in-place argument for both GNU sed and Mac OSX sed | ||
if [[ $(uname -s) == 'Darwin' ]]; then | ||
local ioption='-i .bak' | ||
else | ||
local ioption='-i' | ||
fi | ||
|
||
# set up testing suite if it doesn't yet exist | ||
if [ ! -d $WP_TESTS_DIR ]; then | ||
# set up testing suite | ||
mkdir -p $WP_TESTS_DIR | ||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes | ||
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data | ||
fi | ||
|
||
cd $WP_TESTS_DIR | ||
|
||
if [ ! -f wp-tests-config.php ]; then | ||
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php | ||
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php | ||
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php | ||
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php | ||
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php | ||
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php | ||
fi | ||
|
||
} | ||
|
||
install_db() { | ||
# parse DB_HOST for port or socket references | ||
local PARTS=(${DB_HOST//\:/ }) | ||
local DB_HOSTNAME=${PARTS[0]}; | ||
local DB_SOCK_OR_PORT=${PARTS[1]}; | ||
local EXTRA="" | ||
|
||
if ! [ -z $DB_HOSTNAME ] ; then | ||
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then | ||
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" | ||
elif ! [ -z $DB_SOCK_OR_PORT ] ; then | ||
EXTRA=" --socket=$DB_SOCK_OR_PORT" | ||
elif ! [ -z $DB_HOSTNAME ] ; then | ||
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" | ||
fi | ||
fi | ||
|
||
# create database | ||
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA | ||
} | ||
|
||
install_wp | ||
install_test_suite | ||
install_db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
#We make sure we run this just at one before_deploy hook. | ||
if ! [ $BEFORE_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then | ||
|
||
echo " Preparing deploy. "; | ||
|
||
# Flag the run. | ||
export BEFORE_DEPLOY_RUN=1; | ||
|
||
# Parse the name of the repo. | ||
export THEMEISLE_REPO=$(node -pe "require('./package.json').name") | ||
|
||
# Parse the version of the product. | ||
|
||
export THEMEISLE_VERSION=$(node -pe "require('./package.json').version") | ||
|
||
# Parse product category. | ||
export THEMEISLE_CATEGORY=$(node -pe "require('./package.json').category") | ||
|
||
export DEMO_THEMEISLE_PATH="/sites/demo.themeisle.com/wp-content/$THEMEISLE_CATEGORY/$THEMEISLE_REPO"; | ||
|
||
# Build changelog based on commit message description. | ||
CHANGELOG="\n ### v$THEMEISLE_VERSION - "$(date +'%Y-%m-%d')" \n **Changes:** \n"; | ||
|
||
# Remove first line from the commit as is it used as commit title. | ||
NORMALIZED_MESSAGE=$(sed "1d" <<< "$TRAVIS_COMMIT_MESSAGE"); | ||
|
||
# Save changes list in a sepparately variable as we use it in the release body. | ||
export CHANGES=""; | ||
while read -r line; do | ||
if ! [ -z $line ]; then | ||
line=$(echo "${line//[$'\r\n']}"); | ||
export CHANGES=$CHANGES'- '$line'\n'; | ||
fi; | ||
done <<< "$NORMALIZED_MESSAGE" | ||
|
||
# Concat changes and changelog title and prepend to the changelog file. | ||
|
||
CHANGELOG="$CHANGELOG $CHANGES"; | ||
echo -e "$CHANGELOG $(cat CHANGELOG.md)" > CHANGELOG.md | ||
|
||
# Run the prepare deployment action | ||
|
||
grunt deploy | ||
fi; |
Oops, something went wrong.