-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
83 lines (77 loc) · 2.18 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
# This script runs on gitlab.ebi.ac.uk
image: ebiwd/alpine-ssh
variables:
# project specific variables can be defined here
GIT_SUBMODULE_STRATEGY: recursive
SSH_OWNER_ID: wd_drupl
SSH_APACHE_ID: w3_wd01
S3_BUCKET_DEV: origin.dev.vfwp.emblstatic.net
S3_BUCKET_PROD: origin.vfwp.emblstatic.net
# set secrets in Settings -> Pipelines -> Secret Variables
SSH_OWNER_KEY: secret-key
SSH_APACHE_KEY: secret-key
AWS_KEY: key
AWS_SECRET: secret-key
stages:
- build
- deploy
build:
stage: build
image: ebiwd/docker-drush:3.20
tags:
- docker
script:
- source ./.env
- mkdir -pv data_sync
- export VF_EXTERNAL_PLUGINS_REPO_TAG
# Copy external plugins into actual VF plugins folder for single tag zip file
- rm -rf vfwp-external-plugins || true;
- echo ${VF_EXTERNAL_PLUGINS_REPO_TAG}
- git clone https://github.com/visual-framework/vfwp-external-plugins.git --branch ${VF_EXTERNAL_PLUGINS_REPO_TAG} --depth 1
- rsync -acv --exclude=.git ./vfwp-external-plugins/. wp-content/plugins/
# Create build tag file in vfwp plugin location
- echo "$CI_COMMIT_TAG" > wp-content/plugins/vf-wp/vfwp_build.txt
- cd wp-content/plugins/
- zip -r $CI_PROJECT_DIR/data_sync/plugins.zip .
- cd $CI_PROJECT_DIR/wp-content/themes/
- zip -r $CI_PROJECT_DIR/data_sync/themes.zip .
artifacts:
paths:
- data_sync/
only:
# only match on develop branch, or specific tag patterns
- develop
- master
- /^v\d+\.\d+\.\d+$/
- /^v\d+\.\d+\.\d+-(alpha|beta|rc)\.\d+$/
deploy-dev-aws:
stage: deploy
image: ebiwd/alpine-ssh
tags:
- docker
before_script:
- add-aws-key ${AWS_KEY} ${AWS_SECRET}
dependencies:
- build
script:
- bin/deploy-aws
only:
# only match on develop branch, or specific tag patterns
- develop
- /^v\d+\.\d+\.\d+$/
- /^v\d+\.\d+\.\d+-(alpha|beta|rc)\.\d+$/
deploy-aws-prod:
stage: deploy
image: ebiwd/alpine-ssh
tags:
- docker
before_script:
- add-aws-key ${AWS_KEY} ${AWS_SECRET}
dependencies:
- build
script:
- bin/deploy-aws prod
only:
# only match on specific tag patterns
- /^v\d+\.\d+\.\d+$/
- /^v\d+\.\d+\.\d+-(alpha|beta|rc)\.\d+$/