From 854969a4e8a5cf17b4e549611905ca3262f9f7fd Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Wed, 13 Feb 2019 14:00:26 -0800 Subject: [PATCH] BUGS-2506: Reconcile with 0.6.x branch (#92) --- .travis.yml | 21 ++++++++++++++++----- VERSION | 1 - bin/build-rpm.sh | 22 ---------------------- bin/build-uber-phar.sh | 17 ----------------- bin/build-uber-rpm.sh | 22 ---------------------- utils/make-phar.php | 8 ++++++-- 6 files changed, 22 insertions(+), 69 deletions(-) delete mode 100644 VERSION delete mode 100755 bin/build-rpm.sh delete mode 100755 bin/build-uber-phar.sh delete mode 100755 bin/build-uber-rpm.sh diff --git a/.travis.yml b/.travis.yml index 5e0ac74..9cc79a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ sudo: false - language: php notifications: @@ -10,7 +9,7 @@ notifications: branches: only: - master - - 0.6.x + - "/^v[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+.*$/" php: - 7.0 @@ -18,15 +17,27 @@ php: cache: - composer - - $HOME/.composer/cache + - "$HOME/.composer/cache" env: global: - - WP_CLI_BIN_DIR=/tmp/wp-cli-phar + - WP_CLI_BIN_DIR=/tmp/wp-cli-phar before_script: - bash bin/install-package-tests.sh - composer install + +script: "./vendor/bin/behat --ansi" + +before_deploy: - bash bin/prepare.sh -script: ./vendor/bin/behat +deploy: + provider: releases + api_key: + secure: bP2iK6kCYDVMrbwLEl43mZe2L5ZiYi464kowLrqmI+0vOEblHx4+m5as6AraK5jDFttL68gNwIkOyzQxFbKZDkyntu/aMNa2nXLmhg8T8aGzsHJahpuJMdU/q4e1hysMYXsn03hz31zQiU54DNbRXn9D6oD71u9Rf23FRWFET1w= + file: wp_launch_check.phar + skip_cleanup: true + on: + repo: pantheon-systems/wp_launch_check + tags: true diff --git a/VERSION b/VERSION deleted file mode 100644 index a918a2a..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.6.0 diff --git a/bin/build-rpm.sh b/bin/build-rpm.sh deleted file mode 100755 index fc2f228..0000000 --- a/bin/build-rpm.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# requires fpm (`gem install fpm`) - -name='wp-launch-check' -version=$(cat VERSION) -iteration="$(date +%Y%m%d%H%M).git$(git rev-parse --short HEAD)" # datecode + git sha-ref: "201503020102.gitef8e0fb" -arch='x86_64' -url='https://github.com/pantheon-systems/wp_launch_check' -vendor='Pantheon' -description='Distribution version of wp-launch-check' -install_prefix='/opt/wp-launch-check' - -fpm -s dir -t rpm \ - --name "${name}" \ - --version "${version}" \ - --iteration "${iteration}" \ - --architecture "${arch}" \ - --url "${url}" \ - --vendor "${vendor}" \ - --description "${description}" \ - --prefix "$install_prefix" \ - wp-launch-check.phar diff --git a/bin/build-uber-phar.sh b/bin/build-uber-phar.sh deleted file mode 100755 index 03d8b8f..0000000 --- a/bin/build-uber-phar.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -whereis composer -if [ -f composer.phar ]; then php ./composer.phar update; else composer update; fi - -WORKINGDIR=$PWD -CLIDIR=/tmp/wp-cli -sudo git clone https://github.com/wp-cli/wp-cli $CLIDIR -sudo mkdir -p $CLIDIR/vendor -sudo chown -R travis: $CLIDIR -sudo chmod -R 0777 $CLIDIR -ARGS="--working-dir=$CLIDIR --prefer-dist" -if [ -f composer.phar ]; then php ./composer.phar update $ARGS; else composer update $ARGS; fi -sudo rsync --exclude=.git -avzu $WORKINGDIR/php/ $CLIDIR/php/ -cd $CLIDIR -php -dphar.readonly=0 utils/make-phar.php wp-cli.phar -sudo cp wp-cli.phar $WORKINGDIR/wp-cli.phar -cd $WORKINGDIR diff --git a/bin/build-uber-rpm.sh b/bin/build-uber-rpm.sh deleted file mode 100755 index e3ea36f..0000000 --- a/bin/build-uber-rpm.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# requires fpm (`gem install fpm`) - -name='wp-cli' -version=$(cat VERSION) -iteration="$(date +%Y%m%d%H%M).git$(git rev-parse --short HEAD)" # datecode + git sha-ref: "201503020102.gitef8e0fb" -arch='x86_64' -url='https://github.com/pantheon-systems/wp-launch-check' # custom plugin for wp-cli -vendor='Pantheon' -description='Custom compiled version of wp-cli for use on Pantheon' -install_prefix='/opt/wp-cli' - -fpm -s dir -t rpm \ - --name "${name}" \ - --version "${version}" \ - --iteration "${iteration}" \ - --architecture "${arch}" \ - --url "${url}" \ - --vendor "${vendor}" \ - --description "${description}" \ - --prefix "$install_prefix" \ - wp-cli.phar diff --git a/utils/make-phar.php b/utils/make-phar.php index 54447ee..e27219c 100644 --- a/utils/make-phar.php +++ b/utils/make-phar.php @@ -6,7 +6,11 @@ use Symfony\Component\Finder\Finder; -define( 'DEST_PATH', $argv[1] ); +// Alias -- how to refer to paths inside the phar +$alias = 'wp_launch_check.phar'; + +// DEST_PATH -- where to write the actual phar on the filesystem +define( 'DEST_PATH', $alias ); function add_file( $phar, $path ) { $key = str_replace( WP_LAUNCH_CHECK_ROOT, '', $path ); @@ -20,7 +24,7 @@ function set_file_contents( $phar, $path, $content ) { $phar[ $key ] = $content; } -$phar = new Phar( 'wp_launch_check.phar', 0, 'wp_launch_check.phar' ); +$phar = new Phar( DEST_PATH, 0, $alias ); $phar->startBuffering();