forked from ryantxu/ajax-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
124 lines (117 loc) · 3.41 KB
/
config.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
112
113
114
115
116
117
118
119
120
121
122
123
124
version: 2.1
parameters:
ssh-fingerprint:
type: string
default: ${GITHUB_SSH_FINGERPRINT}
aliases:
# Workflow filters
- &filter-only-master
branches:
only: master
- &filter-only-release
branches:
only: /^v[1-9]*[0-9]+\.[1-9]*[0-9]+\.x$/
workflows:
plugin_workflow:
jobs:
- build
- report:
requires:
- build
- approve_release:
type: approval
requires:
- report
filters: *filter-only-release
- publish_github_release:
requires:
- approve_release
filters: *filter-only-release
executors:
default_exec: # declares a reusable executor
docker:
- image: srclosson/grafana-plugin-ci-alpine:latest
e2e_exec:
docker:
- image: srclosson/grafana-plugin-ci-e2e:latest
jobs:
build:
executor: default_exec
steps:
- checkout
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: |
mkdir ci
[ -f ~/project/node_modules/.bin/grafana-toolkit ] || yarn install --frozen-lockfile
rm -rf ~/project/node_modules/@grafana/data/node_modules
- save_cache:
name: save node_modules
paths:
- ~/project/node_modules
key: build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- save_cache:
name: save cypress cache
paths:
- ~/.cache/Cypress
key: cypress-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Build and test frontend
command: |
rm -rf ~/node_modules/@grafana/data/node_modules
./node_modules/.bin/grafana-toolkit plugin:ci-build
- run:
name: Move results to ci folder
command: ./node_modules/.bin/grafana-toolkit plugin:ci-build --finish
- run:
name: Package distribution
command: |
./node_modules/.bin/grafana-toolkit plugin:ci-package
- persist_to_workspace:
root: .
paths:
- ci/jobs/package
- ci/packages
- ci/dist
- ci/grafana-test-env
- store_artifacts:
path: ci
report:
executor: default_exec
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Toolkit report
command: |
./node_modules/.bin/grafana-toolkit plugin:ci-report
- store_artifacts:
path: ci
publish_github_release:
executor: default_exec
steps:
- checkout
- add_ssh_keys:
fingerprints:
- << pipeline.parameters.ssh-fingerprint >>
- "dc:60:ab:c7:2d:8c:82:50:2a:2a:97:1a:c0:66:83:14"
- ${GITHUB_SSH_FINGERPRINT}
- attach_workspace:
at: .
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: "Publish Release on GitHub"
command: |
./node_modules/.bin/grafana-toolkit plugin:github-publish