-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
111 lines (100 loc) · 3.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
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
image: registry.gitlab.com/digitalsurgeons/build-base:latest
# Cacheing
cache:
paths:
- node_modules/
# - vendor
### Uncomment out the following job for Composer-based projects,
### then remove this notice.
# build_backend:
# script:
# - composer install --no-interaction
# artifacts:
# paths:
# - vendor/
# stage: build
# only:
# - branches
build_frontend:
script:
- npm install
- npm start
artifacts:
paths:
- public_html/
stage: build
only:
- branches
### Use one of the following in your script block in one
### of the deploy_* jobs for different transports.
### For deployments where we have ssh access
# Add private key so we can connect to destination server
# - echo "$SSH_PRIVATE_KEY" > id_rsa
# - chmod 0600 id_rsa
# - rsync --copy-unsafe-links -rvzcSle 'ssh -p 22 -o StrictHostKeyChecking=no -i id_rsa' --exclude-from=.rsyncignore --exclude=public_html/src ./ user@ip:/path/to/project/
### For deployments that must be over FTP (bleh)
### This assumes that you are only deploying the public_html folder (no dynamic scripts).
# - dandelion deploy
### You will additionally need an environment section in your deploy job:
# variables:
# DANDELION_HOST: "$HOST"
# DANDELION_PORT: "$PORT"
# DANDELION_USERNAME: "$FTP_STG_USERNAME"
# DANDELION_PASSWORD: "$FTP_STG_PASSWORD"
# # Dandelion has problems with UTF-8 when it
# # is set as the global ruby default. Unset
# # it here.
# RUBYOPT: ""
### Lastly, you will need to create a dandelion.yml file in the root
### with the contents like the following, which is for a wordpress site:
# adapter: sftp
# host: <%= ENV['DANDELION_HOST'] %>
# port: <%= ENV['DANDELION_PORT'] %>
# username: <%= ENV['DANDELION_USERNAME'] %>
# password: <%= ENV['DANDELION_PASSWORD'] %>
# local_path: public_html/
#
# exclude:
# - wp-admin
# - wp-includes
# - wp-content/mu-plugins
#
# additional:
# - public_html/wp-content/themes/<themename>/dist/: wp-content/themes/<themename>/dist/
### For deployments to an S3 bucket (static sites or assets)
### This assumes that you are only deploying the public_html folder (no dynamic scripts).
### For staging deployments you can remove the exclude for the src folder
# - aws s3 sync --exclude 'src/*' --exclude 'bower_components/*' public_html/ s3://$S3_BUCKET_NAME/
### Uncomment the following for staging and production
### deployments. Remove all of the above comments when done.
# deploy_prod:
# script:
# # Add lines from one of the deployment options above
# stage: deploy
# environment: production
# only:
# - production
#
# deploy_stage:
# script:
# # Add lines from one of the deployment options above
# stage: deploy
# environment: staging
# only:
# - master
### The following is set to deploy to dsdev for boilerplate,
### PLEASE REPLACE "ds-boilerplate" in the path at the end of
### the rsync command to the subdomain name for this project,
### or, if not deploying to dsdev, change the user, ip and path
### to match the desired development environment
### Remove this notice when complete.
deploy_dev:
script:
# Add private key so we can connect to destination server
- echo "$SSH_PRIVATE_KEY" > id_rsa
- chmod 0600 id_rsa
- rsync --copy-unsafe-links -rvzcSle 'ssh -p 22 -o StrictHostKeyChecking=no -i id_rsa' --exclude-from=.rsyncignore ./ [email protected]:/var/www/buffer/
stage: deploy
environment: development
only:
- develop