-
Notifications
You must be signed in to change notification settings - Fork 16
/
.probo.yaml
60 lines (60 loc) · 3.23 KB
/
.probo.yaml
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
55
56
57
58
59
60
image: proboci/ubuntu-14.04-lamp:php-7.1
assets:
- probossh.tar.gz
- sitefarm_seed_local.patch
steps:
- name: Import SSH Keys
plugin: Script
script:
- mkdir $HOME/.ssh
- tar -C $HOME/.ssh -zxvf $ASSET_DIR/probossh.tar.gz
- chmod 600 $HOME/.ssh/id_rsa*
- ssh-keyscan -H bitbucket.org >> $HOME/.ssh/known_hosts
- ls -al $HOME/.ssh
- name: Build Drupal
plugin: Script
script:
- cp -r $SRC_DIR /sitefarm_seed ; mv /sitefarm_seed $SRC_DIR/sitefarm_seed
- cd $SRC_DIR/sitefarm_seed ; git init ; git config user.email "[email protected]" ; git config user.name "Probo CI" ; git add -A ; git commit -m "$COMMIT_REF" -q
- if [ $(git ls-remote --heads https://github.com/ucdavis/sitefarm-distro-template.git $BRANCH_NAME | wc -l) = 1 ]; then BRANCH="$BRANCH_NAME"; else BRANCH=master; fi
- cd $SRC_DIR ; git clone --branch $BRANCH https://github.com/ucdavis/sitefarm-distro-template.git
- cd sitefarm-distro-template ; composer self-update ; composer global update
- git apply $ASSET_DIR/sitefarm_seed_local.patch
- composer install --ansi
- name: Run PhpUnit
plugin: Script
script:
- cd $SRC_DIR/sitefarm-distro-template/web/profiles/sitefarm_seed
- $SRC_DIR/sitefarm-distro-template/vendor/bin/phpunit --colors="always"
- name: Drupal site setup
plugin: Drupal
drupalVersion: 8
subDirectory: sitefarm-distro-template/web
runInstall: true
profileName: sitefarm_subprofile
installArgs: '--site-name="Testing SiteFarm Seed on Probo" --account-pass=probo [email protected]'
- name: Fix files directory permissions
command: 'chown -R www-data:www-data /var/www/html/sites/default/files'
- name: Run Behat NoJS
plugin: Script
script:
- cd /var/www/html/profiles/sitefarm_seed
- cp behat.probo.yml behat.yml
- $SRC_DIR/sitefarm-distro-template/vendor/bin/behat --profile probo --tags "~@javascript" --colors --format progress
- name: Run Behat JS
plugin: Script
script:
- apt-get update > /dev/null 2>&1
- apt-get install google-chrome-stable xvfb -y > /dev/null 2>&1
- wget http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip > /dev/null 2>&1
- unzip chromedriver_linux64.zip -d /usr/bin
- wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar > /dev/null 2>&1
- xvfb-run java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver="/usr/bin/chromedriver" > /dev/null 2>&1 & sleep 5
- cd /var/www/html/profiles/sitefarm_seed
- $SRC_DIR/sitefarm-distro-template/vendor/bin/behat --profile probo --tags "@javascript" --colors --format progress
- name: Post to Slack
plugin: Script
script: |
PR_NAME=$(echo "$PULL_REQUEST_NAME" | tr -d '"')
SLACK="PR <$PULL_REQUEST_LINK|$PR_NAME> has finished building.\n<https://app.probo.ci/#/dashboard/build/$BUILD_ID|Review> the build on Probo\n<$BUILD_DOMAIN/user|Log in> to the fully-built site (username: admin, password: probo)"
curl -X POST --data-urlencode "payload={\"username\": \"Probo.CI Bot\", \"text\": \"$SLACK\", \"icon_emoji\": \":proboci:\"}" https://hooks.slack.com/services/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