Skip to content

Commit

Permalink
Adding pipelines WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed Aug 17, 2016
1 parent c760943 commit 9ca69d7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
43 changes: 43 additions & 0 deletions acquia-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 1.0.0

events:
build:
steps:
# Install global libraries and set global configurations.
- setup-environment:
type: script
script:
- git config --global user.name "Acquia Cloud"
- git config --global user.email "noreply@acquia.com"
- sudo /etc/init.d/mysql start
- mysql -u root -proot -e "CREATE DATABASE drupal" -v

- setup-repository:
type: script
script:
- composer install
# Download, install, and use correct node version.
- nvm download 4.4.1
- nvm install 4.4.1
- nvm use 4.4.1

- run-tests:
type: script
script:
- export PATH=$PATH:$BUILD_DIR/vendor/bin
- drupal init
# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to test the site.
- drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888'
- blt -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-phantom=true ci:build:validate:test

- prepare-artifact:
type: script
script:
# Generate artifact in a separate directory.
- export NEW_BUILD_DIR=/tmp/artifact
- bltl deploy:build -Ddeploy.dir=$NEW_BUILD_DIR
# Copy git history to artifact directory. Required for pipelines to commit and push.
- cp -R $BUILD_DIR/.git $NEW_BUILD_DIR/
# Replace build directory with artifact.
- rm -rf $BUILD_DIR
- mv $NEW_BUILD_DIR $BUILD_DIR
10 changes: 7 additions & 3 deletions template/docroot/sites/default/settings/blt.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@
require_once DRUPAL_ROOT . '/sites/default/settings/local.settings.php';
}

// Load Acquia Pipeline settings.
if (getenv('PIPELINE_ENV') && file_exists(DRUPAL_ROOT . '/sites/default/settings/pipelines.settings.php')) {
require DRUPAL_ROOT . '/sites/default/settings/pipelines.settings.php';
}
// Load Travis CI settings.
if (getenv('TRAVIS') && file_exists(DRUPAL_ROOT . '/sites/default/settings/travis.settings.php')) {
require_once DRUPAL_ROOT . '/sites/default/settings/travis.settings.php';
elseif (getenv('TRAVIS') && file_exists(DRUPAL_ROOT . '/sites/default/settings/travis.settings.php')) {
require DRUPAL_ROOT . '/sites/default/settings/travis.settings.php';
}
// Load Tugboat settings.
elseif (getenv('TUGBOAT_URL') && file_exists(DRUPAL_ROOT . '/sites/default/settings/tugboat.settings.php')) {
require_once DRUPAL_ROOT . '/sites/default/settings/tugboat.settings.php';
require DRUPAL_ROOT . '/sites/default/settings/tugboat.settings.php';
}
}
16 changes: 16 additions & 0 deletions template/docroot/sites/default/settings/pipelines.settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$databases = array(
'default' => array(
'default' => array(
'database' => 'drupal',
'username' => 'root',
'password' => 'root',
'host' => '127.0.0.1',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
'prefix' => '',
),
),
);

0 comments on commit 9ca69d7

Please sign in to comment.