Skip to content

Commit da411ca

Browse files
authored
update ci config (#26)
grab updated ci config from grafana/simple-datasource
1 parent ecac5fe commit da411ca

1 file changed

Lines changed: 64 additions & 155 deletions

File tree

.circleci/config.yml

Lines changed: 64 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,67 @@
1-
version: 2
2-
jobs:
3-
build_plugin:
4-
docker:
5-
- image: circleci/node:10
6-
working_directory: ~/plugin
7-
steps:
8-
- checkout
9-
- restore_cache:
10-
keys:
11-
- yarn-packages-{{ checksum "yarn.lock" }}
12-
- run:
13-
name: Install yarn
14-
command: |
15-
sudo npm install -g yarn --quiet
16-
yarn install --pure-lockfile
17-
- run:
18-
name: Run Toolkit Build
19-
command: npx grafana-toolkit plugin:ci-build
20-
- save_cache:
21-
paths:
22-
- node_modules
23-
key: yarn-packages-{{ checksum "yarn.lock" }}
24-
- persist_to_workspace:
25-
root: .
26-
paths:
27-
- ci
28-
package:
29-
docker:
30-
- image: circleci/node:10
31-
working_directory: ~/plugin
32-
steps:
33-
- checkout
34-
- attach_workspace:
35-
at: .
36-
- restore_cache:
37-
keys:
38-
- yarn-packages-{{ checksum "yarn.lock" }}
39-
- run:
40-
name: Package Distribution
41-
command: npx grafana-toolkit plugin:ci-package
42-
- persist_to_workspace:
43-
root: .
44-
paths:
45-
- ci/jobs/package
46-
- ci/packages
47-
- ci/dist
48-
- ci/grafana-test-env
49-
test_6_2_5:
50-
docker:
51-
- image: circleci/node:10-browsers
52-
working_directory: ~/plugin
53-
steps:
54-
- checkout
55-
- attach_workspace:
56-
at: .
57-
- restore_cache:
58-
keys:
59-
- yarn-packages-{{ checksum "yarn.lock" }}
60-
- run:
61-
name: Setup Grafana (local install)
62-
command: |
63-
wget https://dl.grafana.com/oss/release/grafana_6.2.5_amd64.deb
64-
sudo apt-get install -y adduser libfontconfig1
65-
sudo dpkg -i grafana_6.2.5_amd64.deb
66-
sudo apt-get install locate
67-
sudo updatedb
68-
sudo locate grafana
69-
sudo cat /etc/grafana/grafana.ini
70-
sudo echo ------------------------
71-
sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini
72-
sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini
73-
sudo service grafana-server start
74-
sudo grafana-cli --version
75-
- run:
76-
name: Run e2e tests
77-
command: |
78-
npx grafana-toolkit plugin:ci-test
79-
- persist_to_workspace:
80-
root: .
81-
paths:
82-
- ci/jobs/test_6_2_5
83-
- store_test_results:
84-
path: ci/jobs/test_6_2_5
85-
- store_artifacts:
86-
path: ci/jobs/test_6_2_5
87-
test_6_3_0_beta1:
88-
docker:
89-
- image: circleci/node:10-browsers
90-
working_directory: ~/plugin
91-
steps:
92-
- checkout
93-
- attach_workspace:
94-
at: .
95-
- restore_cache:
96-
keys:
97-
- yarn-packages-{{ checksum "yarn.lock" }}
98-
- run:
99-
name: Setup Grafana (local install)
100-
command: |
101-
wget https://dl.grafana.com/oss/release/grafana_6.3.0-beta1_amd64.deb
102-
sudo apt-get install -y adduser libfontconfig1
103-
sudo dpkg -i grafana_6.3.0-beta1_amd64.deb
104-
sudo apt-get install locate
105-
sudo updatedb
106-
sudo locate grafana
107-
sudo cat /etc/grafana/grafana.ini
108-
sudo echo ------------------------
109-
sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini
110-
sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini
111-
sudo service grafana-server start
112-
sudo grafana-cli --version
113-
- run:
114-
name: Run e2e tests
115-
command: |
116-
npx grafana-toolkit plugin:ci-test
117-
- persist_to_workspace:
118-
root: .
119-
paths:
120-
- ci/jobs/test_6_3_0_beta1
121-
- store_test_results:
122-
path: ci/jobs/test_6_3_0_beta1
123-
- store_artifacts:
124-
path: ci/jobs/test_6_3_0_beta1
125-
report:
126-
docker:
127-
- image: circleci/node:10
128-
working_directory: ~/plugin
129-
steps:
130-
- checkout
131-
- attach_workspace:
132-
at: .
133-
- restore_cache:
134-
keys:
135-
- yarn-packages-{{ checksum "yarn.lock" }}
136-
- run:
137-
name: Toolkit Report
138-
command: npx grafana-toolkit plugin:ci-report
139-
- store_artifacts:
140-
path: ci
1+
version: 2.1
2+
3+
parameters:
4+
ssh-fingerprint:
5+
type: string
6+
default: ${GITHUB_SSH_FINGERPRINT}
7+
8+
aliases:
9+
# Workflow filters
10+
- &filter-only-master
11+
branches:
12+
only: master
13+
- &filter-only-release
14+
branches:
15+
only: /^v[1-9]*[0-9]+\.[1-9]*[0-9]+\.x$/
16+
14117
workflows:
142-
version: 2
14318
plugin_workflow:
14419
jobs:
145-
- build_plugin
146-
- package:
147-
requires:
148-
- build_plugin
149-
- test_6_2_5:
150-
requires:
151-
- package
152-
- test_6_3_0_beta1:
153-
requires:
154-
- package
155-
- report:
156-
requires:
157-
- test_6_2_5
158-
- test_6_3_0_beta1
20+
- build
21+
22+
executors:
23+
default_exec: # declares a reusable executor
24+
docker:
25+
- image: srclosson/grafana-plugin-ci-alpine:latest
26+
e2e_exec:
27+
docker:
28+
- image: srclosson/grafana-plugin-ci-e2e:latest
29+
30+
jobs:
31+
build:
32+
executor: default_exec
33+
steps:
34+
- checkout
35+
- restore_cache:
36+
name: restore node_modules
37+
keys:
38+
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
39+
- run:
40+
name: Install dependencies
41+
command: |
42+
mkdir ci
43+
[ -f ~/project/node_modules/.bin/grafana-toolkit ] || yarn install --frozen-lockfile
44+
- save_cache:
45+
name: save node_modules
46+
paths:
47+
- ~/project/node_modules
48+
key: build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
49+
- run:
50+
name: Build and test frontend
51+
command: ./node_modules/.bin/grafana-toolkit plugin:ci-build
52+
- run:
53+
name: Move results to ci folder
54+
command: ./node_modules/.bin/grafana-toolkit plugin:ci-build --finish
55+
- run:
56+
name: Package distribution
57+
command: |
58+
./node_modules/.bin/grafana-toolkit plugin:ci-package
59+
- persist_to_workspace:
60+
root: .
61+
paths:
62+
- ci/jobs/package
63+
- ci/packages
64+
- ci/dist
65+
- ci/grafana-test-env
66+
- store_artifacts:
67+
path: ci

0 commit comments

Comments
 (0)