Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit e6e9d79

Browse files
author
Mateu Aguiló Bosch
committed
ci: use composer to determine bin directories
1 parent 9337f57 commit e6e9d79

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

scripts/ci/travis/tests/contenta_ci_tests_helper.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
COMPOSER_BIN_DIR="$(composer config bin-dir)"
4+
DOCROOT="web"
5+
36
# Setup Anonymous User Function
47
# Gives access to anonymous user to access protected resources.
58
# This function receives one argument:
@@ -12,14 +15,14 @@ setup_anonymous_user() {
1215

1316
# Setup local variables
1417
current_path=`pwd`
15-
drush=$1/bin/drush
16-
drupal_base=$1/web
18+
DRUSH=$1/$COMPOSER_BIN_DIR/drush
19+
DRUPAL_BASE=$1/$DOCROOT
1720

18-
cd $drupal_base
21+
cd $DRUPAL_BASE
1922
# Add Permission to anonymous user
20-
$drush role-add-perm 'anonymous' 'access jsonapi resource list' -y
21-
$drush updatedb -y
22-
$drush cr -y
23+
$DRUSH role-add-perm 'anonymous' 'access jsonapi resource list' -y
24+
$DRUSH updatedb -y
25+
$DRUSH cr -y
2326

2427
cd $current_path
2528
}
@@ -40,13 +43,13 @@ run_functional_tests() {
4043
fi
4144

4245
current_path=`pwd`
43-
CONTENTA_PATH=$1/web/profiles/contrib/contenta_jsonapi/
44-
PHPUNIT=$1/bin/phpunit
46+
CONTENTA_PATH=$1/$DOCROOT/profiles/contrib/contenta_jsonapi/
47+
PHPUNIT=$1/$COMPOSER_BIN_DIR/phpunit
4548

4649
cd $CONTENTA_PATH
4750

4851
WEB_HOST=$WEB_HOST WEB_PORT=$WEB_PORT $PHPUNIT --testsuite ContentaFunctional
4952
exit $?
5053
}
5154

52-
$@
55+
$@

scripts/development/build-contenta_jsonapi.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
BASE_DIR="$(dirname $(dirname $(cd ${0%/*} && pwd)))"
44

55
COMPOSER="$(which composer)"
6+
COMPOSER_BIN_DIR="$(composer config bin-dir)"
67
DOCROOT="web"
78

89
# Define the color scheme.
@@ -21,7 +22,7 @@ else
2122
echo -e "${FG_C}${WBG_C} WARNING ${NO_C} No installation path provided.\nContenta will be installed in $DEST_DIR."
2223
echo -e "${FG_C}${BG_C} USAGE ${NO_C} ${0} [install_path] # to install in a different directory."
2324
fi
24-
DRUSH="$DEST_DIR/vendor/bin/drush"
25+
DRUSH="$DEST_DIR/$COMPOSER_BIN_DIR/drush"
2526

2627
echo -e "\n\n\n"
2728
echo -e "\t********************************"

0 commit comments

Comments
 (0)