-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
72 lines (70 loc) · 2.45 KB
/
.gitlab-ci.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
image: uofa/s2i-shepherd-drupal:latest
services:
- alias: db
name: centos/mariadb-102-centos7
- alias: mail
name: mailhog/mailhog:latest
- alias: selenium
name: selenium/standalone-chrome:latest
variables:
# build directory.
GIT_CLONE_PATH: "$CI_BUILDS_DIR"
HOME: "$CI_BUILDS_DIR"
# "db" env vars.
MYSQL_DATABASE: drupal
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: super-secret-password
# "app" env vars.
BROWSERTEST_OUTPUT_DIRECTORY: "${CI_BUILDS_DIR}web/sites/simpletest/browser_output"
APPLICATION_ROOT: "${CI_BUILDS_DIR}web"
HASH_SALT: random-hash
PUBLIC_DIR: /shared/public
PRIVATE_DIR: /shared/private
TMP_DIR: /shared/tmp
REDIS_ENABLED: 0
SHEPHERD_INSTALL_PROFILE: ua
SHEPHERD_SECRET_PATH: /code/private
SHEPHERD_TOKEN: super-secret-token
SITE_TITLE: WCMS D8
SITE_MAIL: site@example.com
SITE_ADMIN_EMAIL: admin@example.com
SITE_ADMIN_USERNAME: admin
SITE_ADMIN_PASSWORD: password
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dev-gitlab-runner-build
build:
artifacts:
paths:
- ${BROWSERTEST_OUTPUT_DIRECTORY}
expire_in: 1 hour
when: on_failure
except:
- master
- develop
script:
# Debug the user and groups.
- id
# Use https clone URLs.
- git config --global url."https://${COMPOSER_USER}:${COMPOSER_TOKEN}@gitlab.adelaide.edu.au/".insteadOf "git@gitlab.adelaide.edu.au:"
- git config --global url."https://github.com/".insteadOf 'git@github.com:'
- composer global require hirak/prestissimo
# Setup.
- composer --ignore-platform-reqs --no-progress install
- ./bin/robo dev:xdebug-disable
# Linting
- ./bin/robo lint:php
- ./bin/phpunit --testsuite unit --stop-on-failure
- mkdir -p ${PUBLIC_DIR} ${PRIVATE_DIR} ${TMP_DIR} ${BROWSERTEST_OUTPUT_DIRECTORY}
- chmod +w ${APPLICATION_ROOT}/sites/default ${BROWSERTEST_OUTPUT_DIRECTORY}
- ln -sf ${PUBLIC_DIR} ${APPLICATION_ROOT}/sites/default/files
- cp ${APPLICATION_ROOT}/sites/default/ci.settings.php ${APPLICATION_ROOT}/sites/default/settings.local.php
# Build the site.
- ./bin/robo build:install
- ./bin/robo config:import-plus
- ./bin/robo dev:cache-rebuild
- apache2 &
- sleep ${SLEEP_TIME:-0}
- ./bin/phpunit --stop-on-failure --testsuite kernel
- ./bin/phpunit --stop-on-failure --testsuite functional
- ./bin/phpunit --stop-on-failure --testsuite functionaljs
- ./bin/phpunit --stop-on-failure --testsuite functionalclean