-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
71 lines (63 loc) · 1.63 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
71 lines (63 loc) · 1.63 KB
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
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
COMPOSER_CACHE_DIR: /root/.composer/cache
NPM_CONFIG_CACHE: /root/.npm
before_script:
- echo "ENV_STAGE VARIABLE"
- cp -f $ENV_STAGE ./.env
docker-build:
stage: build
script:
- docker-compose up -d --build
- docker-compose exec -T php composer install
- docker-compose exec -T php php artisan key:generate
- docker-compose exec -T php php artisan config:clear
- docker-compose exec -T php php artisan cache:clear
- docker-compose exec -T php php artisan config:cache
- docker-compose exec -T php php artisan jwt:secret
- docker-compose exec -T node npm install
- docker-compose exec -T node npm run build
artifacts:
expire_in: 1 month
paths:
- vendor/
- node_modules/
- public/css/
- public/js/
- .env
rules:
- if: $CI_COMMIT_TAG =~ /^stage-.*$/
codestyle:
stage: test
script:
- docker-compose exec -T php composer lint
dependencies:
- docker-build
rules:
- if: $CI_COMMIT_TAG =~ /^stage-.*$/
analyse:
stage: test
script:
- docker-compose exec -T php composer analyse
dependencies:
- docker-build
rules:
- if: $CI_COMMIT_TAG =~ /^stage-.*$/
phpunit:
stage: test
script:
- docker-compose exec -T php php artisan test
dependencies:
- docker-build
rules:
- if: $CI_COMMIT_TAG =~ /^stage-.*$/
deploy:
stage: deploy
script:
- echo "Deploying to FTP server"
- curl -T "path/to/local/file" "ftp://$FTP_SERVER/path/to/remote/file" --user "$FTP_USERNAME:$FTP_PASSWORD"
rules:
- if: $CI_COMMIT_TAG =~ /^stage-.*$/