-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
85 lines (78 loc) · 1.8 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
73
74
75
76
77
78
79
80
81
82
83
84
85
image: "gitlab.kent.ac.uk:4567/webdev/astro/php7.1:root-user"
cache:
key: "$CI_BUILD_REF_NAME-assets"
paths:
- $HOME/.composer/cache
- vendor/
- $HOME/.cache
# - node_modules/
services:
- mysql:5.7
- redis:latest
variables:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: test
REDIS_PORT: 6379
before_script:
- php --version
- composer --version
# - yarn --version
- mv .env.gitlab .env
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$CI_SSH_KEY")
- composer config -g github-oauth.github.com ${GITHUB_TOKEN}
- composer global require "hirak/prestissimo:^0.3"
- composer validate --no-check-all --ansi
- composer install --prefer-dist
- export DEFINITIONS_PATH=`pwd`/vendor/unikent/astro-kent-theme
- export PUBLIC_PATH=/site-editor
- export ASTRO_LOGOUT_URL=/site-editor/auth/logout
- yarn install
- yarn run production
- php artisan key:generate
- php artisan migrate --database=mysql_test
stages:
- build-and-test
feature-branch:
stage: build-and-test
script:
- vendor/bin/phpunit
- yarn run validate
- yarn run unit
- rm -rf node_modules .git
artifacts:
paths:
- ./
expire_in: 1 week
except:
- develop
- master
develop:
stage: build-and-test
script:
- vendor/bin/phpunit
- yarn run validate
- yarn run unit
- rm -rf node_modules .git
artifacts:
paths:
- ./
expire_in: 3 months
only:
- develop
master:
stage: build-and-test
script:
# - vendor/bin/phpunit
- yarn run validate
- yarn run unit
- rm -rf node_modules .git
artifacts:
paths:
- ./
expire_in: 6 months
only:
- master