-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
65 lines (63 loc) · 2.42 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
include:
- local: '/.gitlab-ci.deployments.yml'
# Generic dev/feature deployments
- local: '/.gitlab-ci.features.yml'
# Generic front-end build:
- local: '/.gitlab-ci.build-frontend.yml'
# Generic composer build:
- local: '/.gitlab-ci.build-composer.yml'
# Cloudflare cache clearing:
- local: '/.gitlab-ci.cloudflare.yml'
# Generic cypress testing:
- local: '/.gitlab-ci.cypress.yml'
deploy_prod:
extends: .deploy
script:
- echo "$PRD_DOTENV" > .env
- curl -O -L https://gitlab.com/digitalsurgeons/gitlab-ci-configs/raw/master/.rsyncignore
- rsync --copy-unsafe-links -rvzcSl --exclude-from '.rsyncignore' ./ $SERVER_DETAILS_PRD:$SERVER_PATH_PRD/
- >
if [[ $RUN_COMPOSER == "true" ]] && ! [[ "$CI_COMMIT_MESSAGE" =~ ".*skip-backend-build.*" ]]; then
curl -O -L https://gitlab.com/digitalsurgeons/gitlab-ci-configs/raw/master/.rsyncignore-vendor
rsync --copy-unsafe-links -rvzcSl --exclude-from '.rsyncignore-vendor' --delete ./vendor/ $SERVER_DETAILS_PRD:$SERVER_PATH_PRD/vendor/
fi
environment:
name: production
url: $PRD_DOMAIN
when: manual
only:
refs:
- master
variables:
- $PRODUCTION == "true"
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-prod-deploy/
- $CI_COMMIT_MESSAGE =~ /skip-deploy/
deploy_stage:
extends: .deploy
script:
- echo "$STG_DOTENV" > .env
- curl -O -L https://gitlab.com/digitalsurgeons/gitlab-ci-configs/raw/master/.rsyncignore
- rsync --copy-unsafe-links -rvzcSl --exclude-from '.rsyncignore' ./ $SERVER_DETAILS_STG:$SERVER_PATH_STG/
- >
if [[ $RUN_COMPOSER == "true" ]] && ! [[ "$CI_COMMIT_MESSAGE" =~ ".*skip-backend-build.*" ]]; then
curl -O -L https://gitlab.com/digitalsurgeons/gitlab-ci-configs/raw/master/.rsyncignore-vendor
rsync --copy-unsafe-links -rvzcSl --exclude-from '.rsyncignore-vendor' --delete ./vendor/ $SERVER_DETAILS_STG:$SERVER_PATH_STG/vendor/
fi
environment:
name: staging
url: $STG_DOMAIN
only:
refs:
# Deploy from hotfix and release branches as well as master, so we
# can test and make modifications on those branches before finishing
# out a branch. This leads to fewer version bumps and less repo
# noise.
- /^(master|hotfix\/|release\/)/
variables:
- $STAGING == "true"
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-stg-deploy/
- $CI_COMMIT_MESSAGE =~ /skip-deploy/