-
Notifications
You must be signed in to change notification settings - Fork 8
/
pipeline.gocd.yml
91 lines (90 loc) · 2.6 KB
/
pipeline.gocd.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
format_version: 3
pipelines:
appkeepm:
environment_variables:
AWS_PROFILE: "keeBeta"
AWS_REGION: "eu-west-2"
group: frontend
materials:
mygit:
type: configrepo
keeFrontendDependency:
pipeline: keeFrontend
stage: installBuildTestAndPublish
kprpcDependency:
pipeline: kprpc
stage: installBuildTestAndPublish
stages:
- installBuildTestAndPublish:
tasks:
- exec:
command: npm
arguments:
- "ci"
- exec:
command: npm
arguments:
- "run"
- "prod"
- exec:
command: /bin/bash
arguments:
- "-c"
- "aws s3 sync dist/ s3://app-beta.kee.pm"
- exec:
command: /bin/bash
arguments:
- "-c"
- "aws cloudfront create-invalidation --distribution-id E3FJWMTO2ETM37 --paths /\\*"
appkeepmProduction:
environment_variables:
AWS_PROFILE: "keeProd"
AWS_REGION: "eu-west-2"
group: frontend
materials:
mygit:
type: configrepo
appkeepmDependency:
pipeline: appkeepm
stage: installBuildTestAndPublish
stages:
- pause:
tasks:
- exec:
command: pwd
- installBuildTestAndPublish:
approval: manual
tasks:
- exec:
command: npm
arguments:
- "ci"
- exec:
command: npm
arguments:
- "run"
- "prod"
- exec:
command: /bin/bash
arguments:
- "-c"
- "aws s3 sync dist/ s3://keevault.pm"
- exec:
command: /bin/bash
arguments:
- "-c"
- "aws cloudfront create-invalidation --distribution-id E2RDOCYD2M73CI --paths /\\*"
# Encrypted vars in GoCD are very clunky. Recreate as needed by using this hack:
# curl 'https://cd.kee.pm:8154/go/api/admin/encrypt' --insecure -u 'username:password' -H 'Accept: application/vnd.go.cd.v1+json' -H 'Content-Type: application/json' -X POST -d '{"value": "badger"}'
# response:
# {
# "_links" : {
# "doc" : {
# "href" : "https://api.gocd.org/#encryption"
# },
# "self" : {
# "href" : "https://cd.kee.pm:8154/go/api/admin/encrypt"
# }
# },
# "encrypted_value" : "AES:..."
# }