You are here

install.sh in Acquia Content Hub 8.2

Same filename and directory in other branches
  1. 8 tests/travis/install.sh
#!/usr/bin/env bash

# NAME
#     install.sh - Install Travis CI dependencies
#
# SYNOPSIS
#     install.sh
#
# DESCRIPTION
#     Creates the test fixture.

set -ev

cd "$(dirname "$0")" || exit; source _includes.sh

# Create a fixture for the DEPLOY job.
if [[ "$DEPLOY" ]]; then
  mysql -e 'CREATE DATABASE drupal;'
  orca fixture:init \
    -f \
    --sut=drupal/acquia_contenthub \
    --sut-only \
    --core="$CORE" \
    --no-sqlite \
    --no-site-install
  cd "$ORCA_FIXTURE_DIR/docroot/sites/default" || exit 1
  cp default.settings.php settings.php
  chmod 775 settings.php
  drush site:install \
    minimal \
    --db-url=mysql://root:@127.0.0.1/drupal \
    --site-name=ORCA \
    --account-name=admin \
    --account-pass=admin \
    --no-interaction \
    --verbose \
    --ansi
fi

# Create a fixture for the DEPLOY job.
if [[ "$DO_DEV" ]]; then
  mysql -e 'CREATE DATABASE drupal;'
  orca fixture:init \
    -f \
    --sut=drupal/acquia_contenthub \
    --sut-only \
    --core="$CORE" \
    --dev \
    --no-sqlite \
    --no-site-install
  cd "$ORCA_FIXTURE_DIR/docroot/sites/default" || exit 1
  cp default.settings.php settings.php
  chmod 775 settings.php
  drush site:install \
    minimal \
    --db-url=mysql://root:@127.0.0.1/drupal \
    --site-name=ORCA \
    --account-name=admin \
    --account-pass=admin \
    --no-interaction \
    --verbose \
    --ansi
fi

# Exit early in the absence of a fixture.
[[ -d "$ORCA_FIXTURE_DIR" ]] || exit 0

DRUPAL_CORE=9;
if [[ "$ORCA_JOB" == "INTEGRATED_TEST_ON_OLDEST_SUPPORTED" || "$ORCA_JOB" == "INTEGRATED_TEST_ON_LATEST_LTS" || $DEPLOY || $DO_DEV ]]; then
  DRUPAL_CORE=8;
fi

if [[ "$DRUPAL_CORE" == "9" ]]; then
  echo "Adding modules for Drupal 9.x..."
  # @TODO: Make sure to update beta version of webform to a released version once it is released.
  # @TODO: Stop forcing Composer path. Doing it for now to prevent errors.
  /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev \
    drupal/webform \
    drupal/paragraphs \
    drupal/focal_point \
    drupal/redirect \
    drupal/metatag \
    drupal/entityqueue
  # Determining PHPUnit version.
  PHPUNIT_VERSION=`phpunit --version | cut -d ' ' -f 2`
  if [[ $PHPUNIT_VERSION  =~ ^[8] ]]; then
    /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev dms/phpunit-arraysubset-asserts:0.1.1
  else
    /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev dms/phpunit-arraysubset-asserts
  fi
else
  echo "Adding modules for Drupal 8.x..."
  # Eliminating Warnings to avoid failing tests on deprecated functions:
  export SYMFONY_DEPRECATIONS_HELPER=disabled codecept run
  /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev \
    drupal/webform \
    drupal/paragraphs \
    drupal/focal_point \
    drupal/redirect \
    drupal/metatag \
    drupal/entityqueue \
    drupal/s3fs:^3
fi

File

tests/travis/install.sh
View source
  1. #!/usr/bin/env bash
  2. # NAME
  3. # install.sh - Install Travis CI dependencies
  4. #
  5. # SYNOPSIS
  6. # install.sh
  7. #
  8. # DESCRIPTION
  9. # Creates the test fixture.
  10. set -ev
  11. cd "$(dirname "$0")" || exit; source _includes.sh
  12. # Create a fixture for the DEPLOY job.
  13. if [[ "$DEPLOY" ]]; then
  14. mysql -e 'CREATE DATABASE drupal;'
  15. orca fixture:init \
  16. -f \
  17. --sut=drupal/acquia_contenthub \
  18. --sut-only \
  19. --core="$CORE" \
  20. --no-sqlite \
  21. --no-site-install
  22. cd "$ORCA_FIXTURE_DIR/docroot/sites/default" || exit 1
  23. cp default.settings.php settings.php
  24. chmod 775 settings.php
  25. drush site:install \
  26. minimal \
  27. --db-url=mysql://root:@127.0.0.1/drupal \
  28. --site-name=ORCA \
  29. --account-name=admin \
  30. --account-pass=admin \
  31. --no-interaction \
  32. --verbose \
  33. --ansi
  34. fi
  35. # Create a fixture for the DEPLOY job.
  36. if [[ "$DO_DEV" ]]; then
  37. mysql -e 'CREATE DATABASE drupal;'
  38. orca fixture:init \
  39. -f \
  40. --sut=drupal/acquia_contenthub \
  41. --sut-only \
  42. --core="$CORE" \
  43. --dev \
  44. --no-sqlite \
  45. --no-site-install
  46. cd "$ORCA_FIXTURE_DIR/docroot/sites/default" || exit 1
  47. cp default.settings.php settings.php
  48. chmod 775 settings.php
  49. drush site:install \
  50. minimal \
  51. --db-url=mysql://root:@127.0.0.1/drupal \
  52. --site-name=ORCA \
  53. --account-name=admin \
  54. --account-pass=admin \
  55. --no-interaction \
  56. --verbose \
  57. --ansi
  58. fi
  59. # Exit early in the absence of a fixture.
  60. [[ -d "$ORCA_FIXTURE_DIR" ]] || exit 0
  61. DRUPAL_CORE=9;
  62. if [[ "$ORCA_JOB" == "INTEGRATED_TEST_ON_OLDEST_SUPPORTED" || "$ORCA_JOB" == "INTEGRATED_TEST_ON_LATEST_LTS" || $DEPLOY || $DO_DEV ]]; then
  63. DRUPAL_CORE=8;
  64. fi
  65. if [[ "$DRUPAL_CORE" == "9" ]]; then
  66. echo "Adding modules for Drupal 9.x..."
  67. # @TODO: Make sure to update beta version of webform to a released version once it is released.
  68. # @TODO: Stop forcing Composer path. Doing it for now to prevent errors.
  69. /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev \
  70. drupal/webform \
  71. drupal/paragraphs \
  72. drupal/focal_point \
  73. drupal/redirect \
  74. drupal/metatag \
  75. drupal/entityqueue
  76. # Determining PHPUnit version.
  77. PHPUNIT_VERSION=`phpunit --version | cut -d ' ' -f 2`
  78. if [[ $PHPUNIT_VERSION =~ ^[8] ]]; then
  79. /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev dms/phpunit-arraysubset-asserts:0.1.1
  80. else
  81. /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev dms/phpunit-arraysubset-asserts
  82. fi
  83. else
  84. echo "Adding modules for Drupal 8.x..."
  85. # Eliminating Warnings to avoid failing tests on deprecated functions:
  86. export SYMFONY_DEPRECATIONS_HELPER=disabled codecept run
  87. /home/travis/.phpenv/versions/7.3/bin/composer -d"$ORCA_FIXTURE_DIR" require --dev \
  88. drupal/webform \
  89. drupal/paragraphs \
  90. drupal/focal_point \
  91. drupal/redirect \
  92. drupal/metatag \
  93. drupal/entityqueue \
  94. drupal/s3fs:^3
  95. fi