-
Notifications
You must be signed in to change notification settings - Fork 2
/
agnes.yml
85 lines (71 loc) · 1.92 KB
/
agnes.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
agnes:
version: 4
config:
path: .agnes
repository:
url: [email protected]:baupen/agnes-config/web.git
build:
path: .build
github:
api_token: '%env(GITHUB_API_TOKEN)%'
repository: baupen/web
data:
shared_folders:
- var/persistent
- var/transient
files:
- path: .env.local
required: true
- path: assets/report/logo.png
required: true
- path: var/transient/authorization/whitelists/developers.txt
required: false
scripts:
build:
hook: build
script:
- 'composer install --verbose --prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts'
- 'npm install'
- 'npm run build'
- 'cp public/build/email.*.css public/build/email.css'
- 'rm -rf node_modules'
deploy:
hook: deploy
script:
- '{{php}} bin/console cache:clear -n'
- 'find var -type d -print0 | xargs -0 chmod 0755'
- 'find var -type f -print0 | xargs -0 chmod 0644'
- '{{php}} bin/console doctrine:migrations:migrate -n'
- 'cd ../.. && find shared/var -type d -name "protocol_entries" -execdir mv protocol_entries issue_events \;'
rollback:
hook: rollback
script:
- 'cd $PREVIOUS_RELEASE_PATH && export MIGRATE_TO=$({{php}} bin/console doctrine:migrations:latest)'
- '{{php}} bin/console doctrine:migrations:migrate $MIGRATE_TO -n'
backup_db:
script:
- '{{php}} bin/console app:database:backup'
restore_db:
script:
- '{{php}} bin/console app:database:restore'
tasks:
deploy_dev_after_release:
after: release
task: deploy
arguments: { target: '*:*:dev' }
policies:
prod_releases_must_exist_on_staging:
task: deploy
type: stage_write_up
layers:
0: [staging]
1: [prod]
copy_only_to_lower_environments:
task: copy
type: stage_write_down
layers:
0: [dev, staging]
1: [prod]
copy_only_within_same_release:
task: copy
type: same_release