Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shell script installer #184

Merged
merged 4 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
name: Configure PHP
command: |
echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini"
- run:
name: Update Composer
command: |
sudo composer self-update
- run:
name: Create artifacts directory
command: mkdir /tmp/artifacts
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ _Note: If you are starting a new a project, you may be looking for the [drupal-s
$> composer require palantirnet/the-build
```

Composer 2.2.2 or greater is required for the-build.

## Setting up

Install the default templates and phing targets to your project:
Expand Down
25 changes: 11 additions & 14 deletions bin/the-build-installer
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#!/bin/sh
#
# Wrapper for our install command; at least this way it's somewhat discoverable.
# Previously:
#
# The install command boils down to:
# vendor/bin/phing -f vendor/palantirnet/the-build/targets/install.xml
#
# * This script requires Composer 2.2.2 or greater, because of a series of script proxying
# changes between 2.1.x and 2.2.2. This requirement is enforced in composer.json.
# * This script assumes the composer bin dir is at vendor/bin/

# Relative path to this script.
SCRIPT=$(readlink "$0")

# Absolute path to this script's parent directory.
SCRIPTPATH=$(cd `dirname $0` && cd `dirname $SCRIPT` && pwd)

REPOPATH=$(cd `dirname $SCRIPTPATH` && cd ../../../ && pwd)

if [ "$REPOPATH" = `pwd` ]; then
# Run our install task.
$SCRIPTPATH/../../../bin/phing -f $SCRIPTPATH/../targets/install.xml
else
echo "Please run this command from your project root."
# Composer 2.2.2 through 2.2.6
if [ "$COMPOSER_BIN_DIR" != "" ]; then
COMPOSER_RUNTIME_BIN_DIR="$COMPOSER_BIN_DIR"
fi

(cd $COMPOSER_RUNTIME_BIN_DIR/../../ && $COMPOSER_RUNTIME_BIN_DIR/phing -f $COMPOSER_RUNTIME_BIN_DIR/../palantirnet/the-build/targets/install.xml)
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"bin/the-build-installer"
],
"require": {
"composer-runtime-api": "^2.2.2",
"cweagans/composer-patches": "^1.7",
"drupal/coder": "^8.3.6",
"drush/drush": "^9 || ^10",
Expand All @@ -29,7 +30,11 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cweagans/composer-patches": true
}
},
"extra": {
"patches": {
Expand Down
4 changes: 4 additions & 0 deletions defaults/install/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
name: Configure PHP
command: |
echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini"
- run:
name: Update Composer
command: |
sudo composer self-update
- run:
name: Create artifacts directory
command: mkdir /tmp/artifacts
Expand Down