-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.features.yml
69 lines (66 loc) · 2.46 KB
/
.gitlab-ci.features.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
# The dev and feature deployments should be entirely generic to any
# project. Only modify if you have things like symlinking upload
# directories or other script actions to worry about Furthermore, if you
# need to modify you can override from the .gitlab-ci.main.yml main file
deploy_dev:
extends: .deploy
script:
- echo "$DEV_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_DEV:$SERVER_PATH_DEV/
- >
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_DEV:$SERVER_PATH_DEV/vendor/
fi
environment:
name: development
url: https://$CI_PROJECT_NAME.$DEV_DOMAIN
only:
refs:
- develop
variables:
- $DEVELOP == "true"
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-dev-deploy/
- $CI_COMMIT_MESSAGE =~ /skip-deploy/
deploy_feature:
extends: .deploy
script:
- echo "$DEV_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_FEATURE:$SERVER_PATH_FEATURE/
- >
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_FEATURE:$SERVER_PATH_FEATURE/vendor/
fi
environment:
name: $CI_COMMIT_REF_NAME
url: https://$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$FEATURE_DOMAIN
on_stop: teardown_feature
only:
refs:
- /^feature\//
variables:
- $FEATURE == "true"
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-feature-deploy/
- $CI_COMMIT_MESSAGE =~ /skip-deploy/
teardown_feature:
extends: .deploy
variables:
GIT_STRATEGY: none
script:
- ssh $SERVER_DETAILS_DEV rm -rf $SERVER_PATH_FEATURE/
environment:
name: $CI_COMMIT_REF_NAME
action: stop
when: manual
only:
refs:
- /^feature\//
variables:
- $FEATURE == "true"