-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
62 lines (55 loc) · 1.25 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
# set the default docker image
image: registry.gitlab.com/tjvb/phpimages:php82_node
stages:
- prepare # prepare the cache
- check # check the codestyles
- deploy
prepare_cache:
stage: prepare
script:
# Install composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar validate
- php composer.phar install
# we use this artifact for all the jobs
artifacts:
name: "vendor"
paths:
- composer.phar
- vendor/*
lint:
stage: check
script:
# lint recursive
- find app/ -type f -name '*.php' -exec php -l {} \; | (! grep -v "No syntax errors detected" )
dependencies: []
pint:
stage: check
script:
- vendor/bin/pint
dependencies:
- prepare_cache
needs:
- prepare_cache
phpmd:
stage: check
script:
- vendor/bin/phpmd app/ text phpmd.xml.dist
dependencies:
- prepare_cache
needs:
- prepare_cache
deploy:
stage: deploy
before_script:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
script:
- vendor/bin/dep deploy -vvv
environment: production
resource_group: production
only:
- main