-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
144 lines (133 loc) · 3.98 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
image: docker:latest
before_script:
- apk add --no-cache curl jq python py-pip bash findutils git zlib-dev openssh-client php7 php7-json php7-phar php7-iconv php7-openssl php7-mbstring php7-simplexml php7-tokenizer php7-xmlwriter php7-ctype php7-curl php7-dom patch php7-fileinfo mariadb-client php7-gd php7-intl php7-xsl php7-pdo php7-session php7-xml ruby ruby-io-console ruby-irb ruby-json ruby-rake ruby-rdoc
- pip install --upgrade pip
- pip install awscli
- curl --silent --show-error https://getcomposer.org/installer | php
stages:
- build
- deploy
- test
build:ProjectContainer:
stage: build
variables:
PURL: "$CI_COMMIT_REF_SLUG"
script:
- cp .ci/Dockerfile ./Dockerfile
- cp .ci/ecsbuildpush.sh ./ecsbuildpush.sh
- chmod +x ecsbuildpush.sh
- /bin/bash ecsbuildpush.sh $PROJ_NAME $PURL build proj
only:
- develop
- /^feature.*$/
build:ProjectDB:
stage: build
variables:
PURL: "$CI_COMMIT_REF_SLUG"
script:
- cp .ci/ecsbuildpush.sh ./ecsbuildpush.sh
- chmod +x ecsbuildpush.sh
- /bin/bash ecsbuildpush.sh $PROJ_NAME $PURL build db
only:
- develop
- /^feature.*$/
stop:featureDB:
stage: build
variables:
PURL: "$CI_COMMIT_REF_SLUG"
when: manual
only:
- /^feature.*$/
environment:
name: "$PROJ_NAME/$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME-$CI_COMMIT_REF_SLUG.demo.ffw-cs.com"
action: stop
script:
- cp .ci/ecsbuildpush.sh ./ecsbuildpush.sh
- chmod +x ecsbuildpush.sh
- /bin/bash ecsbuildpush.sh $PROJ_NAME $PURL build dropdb
- cp .ci/ecsstop.sh ./ecsstop.sh
- chmod +x ecsstop.sh
- /bin/bash ecsstop.sh $PROJ_NAME $PURL stopfeat
stop:developDB:
stage: build
variables:
PURL: "$CI_COMMIT_REF_SLUG"
when: manual
only:
- develop
environment:
name: "$PROJ_NAME-$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME.demo.ffw-cs.com"
action: stop
script:
- cp .ci/ecsbuildpush.sh ./ecsbuildpush.sh
- chmod +x ecsbuildpush.sh
- /bin/bash ecsbuildpush.sh $PROJ_NAME $PURL build dropdb
- cp .ci/ecsstop.sh ./ecsstop.sh
- chmod +x ecsstop.sh
- /bin/bash ecsstop.sh $PROJ_NAME $PURL stopfeat
code-quality-checks:
stage: test
script:
- echo "Code Sniffer"
- php composer.phar global require drupal/coder
- ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
- ~/.composer/vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme $BUILDSDIR/$PROJ_DOCROOT/sites/all/modules/custom/
deploy:develop:
stage: deploy
variables:
PURL: "$CI_COMMIT_REF_SLUG"
environment:
name: "$PROJ_NAME-$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME.demo.ffw-cs.com"
only:
- develop
script:
- cp .ci/ecsdeploy.sh ecsdeploy.sh
- chmod +x ecsdeploy.sh
- /bin/bash ecsdeploy.sh $PROJ_NAME $PURL deploydev
deploy:feature:
stage: deploy
variables:
PURL: "$CI_COMMIT_REF_SLUG"
environment:
name: "$PROJ_NAME/$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME-$CI_COMMIT_REF_SLUG.demo.ffw-cs.com"
on_stop: stop:feature
only:
- /^feature.*$/
script:
- cp .ci/ecsdeploy.sh ./ecsdeploy.sh
- chmod +x ecsdeploy.sh
- /bin/bash ecsdeploy.sh $PROJ_NAME $PURL deployfeat
stop:develop:
stage: deploy
variables:
PURL: "$CI_COMMIT_REF_SLUG"
when: manual
only:
- develop
environment:
name: "$PROJ_NAME-$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME-$CI_COMMIT_REF_SLUG.demo.ffw-cs.com"
action: stop
script:
- cp .ci/ecsstop.sh ./ecsstop.sh
- chmod +x ecsstop.sh
- /bin/bash ecsstop.sh $PROJ_NAME $PURL stopfeat
stop:feature:
stage: deploy
variables:
PURL: "$CI_COMMIT_REF_SLUG"
when: manual
only:
- /^feature.*$/
environment:
name: "$PROJ_NAME/$CI_COMMIT_REF_SLUG"
url: "https://$PROJ_NAME-$CI_COMMIT_REF_SLUG.demo.ffw-cs.com"
action: stop
script:
- cp .ci/ecsstop.sh ./ecsstop.sh
- chmod +x ecsstop.sh
- /bin/bash ecsstop.sh $PROJ_NAME $PURL stopfeat