-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
80 lines (71 loc) · 1.89 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
image: evolvingweb/drupal-fpm:ci-8.1
# Uncomment the following lines if you need a full Drupal.
#services:
# - mariadb:10.5
stages:
- build
- deploy
variables:
THEME_DIR: docroot/themes/custom/nobs_glider
BLT: ./vendor/bin/blt
BLT_DIR: ./vendor/acquia/blt
DRUPAL_CI_DIR: ./vendor/evolvingweb/drupal-ci
MYSQL_DATABASE: drupal
MYSQL_ROOT_PASSWORD: drupal
cache:
paths:
- $THEME_DIR/node_modules
- .composer-cache/
# CI image default to composer v1 for backwords compatibiliy with old sites,
# here we set to version 2. Change to v1 if needed refs #24677 #24833
before_script:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa
- ssh-add ~/.ssh/id_rsa
- composer config -g cache-dir "$(pwd)/.composer-cache"
- composer self-update --2
- composer validate --no-check-all --ansi
- composer install
- source ~/.bashrc
- cd $THEME_DIR && nvm install
- cd $CI_PROJECT_DIR
build:
stage: build
script:
- $BLT validate
- $BLT source:build --ansi --verbose --no-interaction
# Uncomment the following lines if you need a full Drupal. @dev alias needs to be added to the repo.
# - DRUSH="./vendor/bin/drush"
# - $DRUSH sql-sync @dev @self
deploy_branch:
stage: deploy
script:
- $DRUPAL_CI_DIR/scripts/ssh_key_add
- $DRUPAL_CI_DIR/scripts/deploy_branch
only:
- branches
except:
- staging
deploy_tag:
stage: deploy
script:
- $DRUPAL_CI_DIR/scripts/ssh_key_add
- $DRUPAL_CI_DIR/scripts/deploy_tag
only:
- tags
deploy_staging:
stage: deploy
script:
- $DRUPAL_CI_DIR/scripts/ssh_key_add
- scripts/deploy_artifact
only:
- staging
validate_prod:
stage: deploy
script:
- $DRUPAL_CI_DIR/scripts/ssh_key_add
- $DRUPAL_CI_DIR/acquia/validate-prod-clean
only:
- tags