forked from acquia/blt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacquia-pipelines.yml
54 lines (50 loc) · 2.3 KB
/
acquia-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: 1.0.0
events:
build:
steps:
# Install global packages and set global configuration.
- setup-environment:
type: script
script:
- git config --global user.name "Acquia Cloud"
- git config --global user.email "[email protected]"
- sudo /etc/init.d/mysql start
- mysql -u root -proot -e "CREATE DATABASE drupal" -v
# Install project level packages and set project level configuration.
- setup-project:
type: script
script:
- composer install
- nvm install 4.4.1
- nvm use 4.4.1
# Execute all testing and validation tasks.
- run-tests:
type: script
script:
- export PATH=$PATH:$BUILD_DIR/vendor/bin
# Install chromedriver.
- ./vendor/acquia/blt/scripts/linux/chromedriver.sh $BUILD_DIR/vendor/bin
# Initialize xvfb (see https://docs.travis-ci.com/user/gui-and-headless-browsers)
- sudo apt-get install xvfb
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to test the site.
- drupal init
- 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
# Generate
- prepare-artifact:
type: script
script:
- export PATH=$PATH:$BUILD_DIR/vendor/bin
# Generate artifact in a separate directory.
- export NEW_BUILD_DIR=/tmp/artifact
- blt deploy:build -Ddeploy.dir=$NEW_BUILD_DIR
# Move git history to artifact directory. Required for pipelines to commit and push.
- mv $BUILD_DIR/.git $NEW_BUILD_DIR/
# Allow dotfiles (hidden) to be globbed (via *).
- shopt -s dotglob
# Remove all files, including hidden files, from working directory.
- rm -rf $BUILD_DIR/*
# Move all files, including hidden files, from build artifact into working directory.
- mv $NEW_BUILD_DIR/* $BUILD_DIR/