-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
90 lines (83 loc) · 2.26 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
86
87
88
89
90
stages:
- lint
- test
- version
lint:full:
image: php:7.1.33-alpine
stage: lint
before_script: # Override global `before_script`
- php -v
script:
- find './' -type f -name '*.php' -not -path './vendor/*' -not -path './var/*' -print0 | xargs -n 1 -0 php -l
when: manual
only:
- merge_requests
test:all:
image: php:7.1.33-alpine
stage: test
script:
- composer install --dev -q
- php vendor/bin/phpunit
when: manual
only:
- merge_requests
test:coverage:
image: php:7.1.33-alpine
stage: test
artifacts:
paths:
- tests/output/
expire_in: 2 day
script:
- composer install --dev -q
- php vendor/bin/phpunit --coverage-html=tests/output --coverage-text --colors=never
when: manual
only:
- merge_requests
.setup_env: &setup_env
before_script:
- wget https://getcomposer.org/download/1.10.22/composer.phar
- chmod +x composer.phar
- mv composer.phar /usr/local/bin/composer
- 'which ssh-agent || apk add --no-cache openssh'
- 'which git || apk add --no-cache git'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git remote set-url origin git@gitlab.com:enuage/bundles/version-updater.git
- git config --global user.email "spam312sn@gmail.com"
- git config --global user.name "Serghei Niculaev"
- git checkout $CI_COMMIT_REF_NAME
version:major:
<<: *setup_env
image: php:7.1.33-alpine
stage: version
script:
- composer install -q
- php bin/version-updater --major
when: manual
only:
- master
version:minor:
<<: *setup_env
image: php:7.1.33-alpine
stage: version
script:
- composer install -q
- php bin/version-updater --minor
when: manual
only:
- master
version:patch:
<<: *setup_env
image: php:7.1.33-alpine
stage: version
script:
- composer install -q
- php bin/version-updater --patch
when: manual
only:
- master