-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
79 lines (69 loc) · 1.32 KB
/
.gitlab-ci.yml
File metadata and controls
79 lines (69 loc) · 1.32 KB
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
image: node:12
stages:
- build
- deploy
- notify_success
- notify_failure
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
.build:
stage: build
tags:
- web
script:
- yarn install
- yarn run bundle
artifacts:
paths:
- build/
.deploy:
stage: deploy
tags:
- web
script:
- echo "Uploading build"
- |
curl --request POST "https://api.swaggerhub.com/apis/$SWAGGERHUB_OWNER/$SWAGGERHUB_API_NAME" \
--header "Authorization: $SWAGGERHUB_API_KEY" \
--header "Content-Type: application/yaml" \
--data-binary @build/swagger/online_store_api.yaml
- echo "Build uploaded"
.notify_success:
stage: notify_success
tags:
- web
script:
- ./gitlab_ci_slack_notification.sh -s success
.notify_failure:
stage: notify_failure
tags:
- web
script:
- ./gitlab_ci_slack_notification.sh -s failure
when: on_failure
build:production:
extends: .build
only:
refs:
- master
environment: production
deploy:production:
extends: .deploy
only:
refs:
- master
environment: production
notify_success:production:
extends: .notify_success
only:
refs:
- master
environment: production
notify_failure:production:
extends: .notify_failure
only:
refs:
- master
environment: production