Install Composer PHAR to tools directory
[MAILPOET-2405]
This commit is contained in:
committed by
Jack Kitterhing
parent
26818042f4
commit
c0d77e4564
@ -19,10 +19,9 @@ jobs:
|
|||||||
name: "Set up test environment"
|
name: "Set up test environment"
|
||||||
command: |
|
command: |
|
||||||
# install plugin dependencies
|
# install plugin dependencies
|
||||||
curl -sS https://getcomposer.org/installer | php
|
COMPOSER_DEV_MODE=1 php tools/install.php
|
||||||
./composer.phar validate --no-check-all --no-check-publish
|
./tools/vendor/composer.phar validate --no-check-all --no-check-publish
|
||||||
./composer.phar validate --no-check-all --no-check-publish --working-dir=prefixer
|
./tools/vendor/composer.phar validate --no-check-all --no-check-publish --working-dir=prefixer
|
||||||
./composer.phar install
|
|
||||||
touch .env
|
touch .env
|
||||||
./do install
|
./do install
|
||||||
./do compile:all --env production
|
./do compile:all --env production
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
TODO
|
TODO
|
||||||
composer.phar
|
|
||||||
/vendor
|
/vendor
|
||||||
/vendor-prefixed
|
/vendor-prefixed
|
||||||
/vendor_backup
|
/vendor_backup
|
||||||
|
@ -27,11 +27,6 @@ $ cd mailpoet
|
|||||||
# create the .env file
|
# create the .env file
|
||||||
$ cp .env.sample .env
|
$ cp .env.sample .env
|
||||||
# change the values on .env file
|
# change the values on .env file
|
||||||
# download composer
|
|
||||||
$ curl -sS https://getcomposer.org/installer | php
|
|
||||||
$ chmod +x ./composer.phar
|
|
||||||
# install PHP dependencies
|
|
||||||
$ ./composer.phar install
|
|
||||||
# install all dependencies (PHP and JS)
|
# install all dependencies (PHP and JS)
|
||||||
$ ./do install
|
$ ./do install
|
||||||
# compile JS and CSS files
|
# compile JS and CSS files
|
||||||
|
@ -19,7 +19,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
function install() {
|
function install() {
|
||||||
return $this->taskExecStack()
|
return $this->taskExecStack()
|
||||||
->stopOnFail()
|
->stopOnFail()
|
||||||
->exec('./composer.phar install')
|
->exec('./tools/vendor/composer.phar install')
|
||||||
->exec('npm ci --prefer-offline')
|
->exec('npm ci --prefer-offline')
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
function update() {
|
function update() {
|
||||||
return $this->taskExecStack()
|
return $this->taskExecStack()
|
||||||
->stopOnFail()
|
->stopOnFail()
|
||||||
->exec('./composer.phar update')
|
->exec('./tools/vendor/composer.phar update')
|
||||||
->exec('npm update')
|
->exec('npm update')
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
return $this->collectionBuilder()
|
return $this->collectionBuilder()
|
||||||
->taskExec('rm -rf ' . __DIR__ . '/vendor/goaop')
|
->taskExec('rm -rf ' . __DIR__ . '/vendor/goaop')
|
||||||
->taskExec('rm -rf ' . __DIR__ . '/vendor/nikic')
|
->taskExec('rm -rf ' . __DIR__ . '/vendor/nikic')
|
||||||
->taskExec('cd ' . __DIR__ . ' && ./composer.phar dump-autoload')
|
->taskExec('cd ' . __DIR__ . ' && ./tools/vendor/composer.phar dump-autoload')
|
||||||
->taskExec(
|
->taskExec(
|
||||||
'WP_ROOT="' . getenv('WP_ROOT') . '" ' .
|
'WP_ROOT="' . getenv('WP_ROOT') . '" ' .
|
||||||
'php -d memory_limit=2G ' .
|
'php -d memory_limit=2G ' .
|
||||||
@ -435,7 +435,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
"$dir/lib"
|
"$dir/lib"
|
||||||
)
|
)
|
||||||
->dir(__DIR__ . '/tasks/phpstan')
|
->dir(__DIR__ . '/tasks/phpstan')
|
||||||
->taskExec('cd ' . __DIR__ . ' && ./composer.phar install')
|
->taskExec('cd ' . __DIR__ . ' && ./tools/vendor/composer.phar install')
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
build.sh
8
build.sh
@ -30,7 +30,7 @@ npm ci --prefer-offline
|
|||||||
|
|
||||||
# Dependency injection container cache.
|
# Dependency injection container cache.
|
||||||
echo '[BUILD] Building DI Container cache'
|
echo '[BUILD] Building DI Container cache'
|
||||||
./composer.phar install
|
./tools/vendor/composer.phar install
|
||||||
./do container:dump
|
./do container:dump
|
||||||
|
|
||||||
# Generate Doctrine metadata
|
# Generate Doctrine metadata
|
||||||
@ -53,16 +53,16 @@ fi
|
|||||||
# Production libraries.
|
# Production libraries.
|
||||||
echo '[BUILD] Fetching production libraries'
|
echo '[BUILD] Fetching production libraries'
|
||||||
mkdir vendor-prefixed
|
mkdir vendor-prefixed
|
||||||
./composer.phar install --no-dev --prefer-dist --optimize-autoloader --no-scripts
|
./tools/vendor/composer.phar install --no-dev --prefer-dist --optimize-autoloader --no-scripts
|
||||||
|
|
||||||
echo '[BUILD] Fetching prefixed production libraries'
|
echo '[BUILD] Fetching prefixed production libraries'
|
||||||
./composer.phar install --prefer-dist --working-dir=./prefixer/
|
./tools/vendor/composer.phar install --prefer-dist --working-dir=./prefixer/
|
||||||
|
|
||||||
# Remove Doctrinne Annotations (no need since generated metadata are packed)
|
# Remove Doctrinne Annotations (no need since generated metadata are packed)
|
||||||
# Should be removed before `dump-autoload` to not include the annotations classes on the autoloader.
|
# Should be removed before `dump-autoload` to not include the annotations classes on the autoloader.
|
||||||
rm -rf vendor-prefixed/doctrine/annotations
|
rm -rf vendor-prefixed/doctrine/annotations
|
||||||
|
|
||||||
./composer.phar dump-autoload
|
./tools/vendor/composer.phar dump-autoload
|
||||||
|
|
||||||
# Copy release folders.
|
# Copy release folders.
|
||||||
echo '[BUILD] Copying release folders'
|
echo '[BUILD] Copying release folders'
|
||||||
|
@ -77,14 +77,14 @@
|
|||||||
"post-update-cmd": [
|
"post-update-cmd": [
|
||||||
"@fixPHPUnit57CodeCoverageForPHP72",
|
"@fixPHPUnit57CodeCoverageForPHP72",
|
||||||
"./prefixer/process.sh",
|
"./prefixer/process.sh",
|
||||||
"./composer.phar dump-autoload",
|
"./tools/vendor/composer.phar dump-autoload",
|
||||||
"./composer.phar --working-dir=tasks/code_sniffer install"
|
"./tools/vendor/composer.phar --working-dir=tasks/code_sniffer install"
|
||||||
],
|
],
|
||||||
"post-install-cmd": [
|
"post-install-cmd": [
|
||||||
"@fixPHPUnit57CodeCoverageForPHP72",
|
"@fixPHPUnit57CodeCoverageForPHP72",
|
||||||
"./prefixer/process.sh",
|
"./prefixer/process.sh",
|
||||||
"./composer.phar dump-autoload",
|
"./tools/vendor/composer.phar dump-autoload",
|
||||||
"./composer.phar --working-dir=tasks/code_sniffer install"
|
"./tools/vendor/composer.phar --working-dir=tasks/code_sniffer install"
|
||||||
],
|
],
|
||||||
"fixPHPUnit57CodeCoverageForPHP72": "sed -i -- 's/\\$numTests = count(\\$coverageData\\[\\$i\\]);/$numTests = (is_array($coverageData[$i]) ? count($coverageData[$i]) : 0);/g' vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php"
|
"fixPHPUnit57CodeCoverageForPHP72": "sed -i -- 's/\\$numTests = count(\\$coverageData\\[\\$i\\]);/$numTests = (is_array($coverageData[$i]) ? count($coverageData[$i]) : 0);/g' vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php"
|
||||||
},
|
},
|
||||||
|
13
do
Executable file
13
do
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
DIR=$(dirname $0)
|
||||||
|
ROBO=$DIR/vendor/bin/robo
|
||||||
|
|
||||||
|
# Robo executable not found, install dev tools (including Composer) and PHP packages (including Robo)
|
||||||
|
if [ ! -f $ROBO ]; then
|
||||||
|
COMPOSER_DEV_MODE=1 php tools/install.php
|
||||||
|
./tools/vendor/composer.phar install
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pass command to Robo
|
||||||
|
$ROBO "$@"
|
@ -1,11 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
DRY_RUN_CHECK=$($BASEDIR/../composer.phar install --working-dir=$BASEDIR --dry-run 2>&1 | grep 'Nothing to install or update')
|
COMPOSER_BIN=$BASEDIR/../tools/vendor/composer.phar
|
||||||
|
DRY_RUN_CHECK=$($COMPOSER_BIN install --working-dir=$BASEDIR --dry-run 2>&1 | grep 'Nothing to install or update')
|
||||||
|
|
||||||
if [[ $DRY_RUN_CHECK != "Nothing to install or update" ]]; then
|
if [[ $DRY_RUN_CHECK != "Nothing to install or update" ]]; then
|
||||||
rm -rf $BASEDIR/build
|
rm -rf $BASEDIR/build
|
||||||
fi
|
fi
|
||||||
if [[ ! -e $BASEDIR/build || -z $(ls -A $BASEDIR/../vendor-prefixed) ]]; then
|
if [[ ! -e $BASEDIR/build || -z $(ls -A $BASEDIR/../vendor-prefixed) ]]; then
|
||||||
$BASEDIR/../composer.phar install --working-dir=$BASEDIR
|
$COMPOSER_BIN install --working-dir=$BASEDIR
|
||||||
fi
|
fi
|
||||||
|
@ -68,8 +68,8 @@ sed -i "s/define( *'WP_DEBUG', false *);/$CONFIG/" ./wp-config.php
|
|||||||
# Example: docker-compose run -e SKIP_DEPS=1 codeception ...
|
# Example: docker-compose run -e SKIP_DEPS=1 codeception ...
|
||||||
if [[ -z "${SKIP_DEPS}" ]]; then
|
if [[ -z "${SKIP_DEPS}" ]]; then
|
||||||
cd /project
|
cd /project
|
||||||
php composer.phar install
|
./tools/vendor/composer.phar install
|
||||||
cd /wp-core
|
cd - >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# activate MailPoet
|
# activate MailPoet
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$tools = [
|
$tools = [
|
||||||
|
'https://github.com/composer/composer/releases/download/1.9.0/composer.phar' => 'composer.phar',
|
||||||
'https://github.com/humbug/php-scoper/releases/download/0.11.4/php-scoper.phar' => 'php-scoper.phar',
|
'https://github.com/humbug/php-scoper/releases/download/0.11.4/php-scoper.phar' => 'php-scoper.phar',
|
||||||
'https://github.com/phpstan/phpstan/releases/download/0.11.5/phpstan.phar' => 'phpstan.phar',
|
'https://github.com/phpstan/phpstan/releases/download/0.11.5/phpstan.phar' => 'phpstan.phar',
|
||||||
'https://github.com/nette/tracy/releases/download/v2.6.4/tracy.phar' => 'tracy.phar',
|
'https://github.com/nette/tracy/releases/download/v2.6.4/tracy.phar' => 'tracy.phar',
|
||||||
|
Reference in New Issue
Block a user