Skip to content

Instantly share code, notes, and snippets.

@ygerasimov
Created July 12, 2017 17:00
Show Gist options
  • Save ygerasimov/6681a2aa89c4e8f7f51709559236d046 to your computer and use it in GitHub Desktop.
Save ygerasimov/6681a2aa89c4e8f7f51709559236d046 to your computer and use it in GitHub Desktop.
# Lamp + PHP CS + Drush
image: sharpe/drupal:latest
pipelines:
branches:
8.x-1.x:
- step:
script:
#start mysql and create drupal db
- service mysql start
- mysql -h localhost --user=root --password=root -e "CREATE DATABASE drupal;"
# Install from composer.json
- composer install --no-interaction
# Run PHP Code Sniffer on custom modules
- phpcs --standard=Drupal --ignore=node_modules,*.css,*.md,*.txt,*.info.yml docroot/profiles/contrib/openedu
# Make our repo the webroot
- rm -rf /var/www
- ln -s docroot html
- ln -s $(pwd) /var/www
#for some reason apache doesn't start by default when docker images are run through Bitbucket CI, so we start it manually
- apache2-foreground > /dev/null 2>&1 &
# Navigate to the root to run out tests
- cd /var/www/html
# setup a generic site install, needed for testing
- drush status
- drush si openedu --db-url='mysql://root:[email protected]/drupal' --account-pass='imagex' -y
# Run Tests
- export SIMPLETEST_DB=mysql://root:[email protected]/drupal
- export SIMPLETEST_BASE_URL=http://localhost/
- ../bin/phpunit -c core ./profiles/contrib/openedu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment