-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
56 lines (48 loc) · 1.49 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
image: registry.git.ryuu.technology/docker/gitlabrunners/phpcomposer:latest
services:
- docker:dind
stages:
- build
- test
variables:
# CONTAINER_IMAGE: $CI_REGISTRY/docker/gitlabrunners/phpcomposer
# CONTAINER_IMAGE: registry.git.ryuu.technology/$CI_PROJECT_PATH
VERSION_MAJOR: 0
VERSION_MINOR: 0
VERSION_PATCH: 0
DOMAIN: git.ryuu.technology
before_script:
- export VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}+${CI_PIPELINE_ID}"
- export CI_PROJECT_SSH_URL=git@${DOMAIN}:${CI_PROJECT_PATH}
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- ssh-keyscan -p 2200 -t rsa ${DOMAIN} >> ~/.ssh/known_hosts
- echo -e "Host ${DOMAIN}\n HostName ${DOMAIN}\n Port 2200\n User git\n IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
- echo -e "$AUTO_TAGGING_KEY" >> ~/.ssh/id_rsa
- chmod 700 -R ~/.ssh
- git remote set-url --push origin ${CI_PROJECT_SSH_URL}
- git config user.email "${GITLAB_USER_EMAIL}"
- git config user.name "${GITLAB_USER_LOGIN}"
after_script:
- rm -Rf ~/.ssh
build:
stage: build
only:
- master
artifacts:
paths:
- ./vendor/
script:
- composer install -n --no-progress --apcu-autoloader
test:
stage: test
only:
- master
artifacts:
paths:
- ./vendor/
script:
- ./vendor/bin/phpunit --coverage-text --colors=never
- git tag -a "v${VERSION}" -m "CI Auto Tagging"
- git push origin v${VERSION}