config.yml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. aliases:
  2. # Workflow filters
  3. - &filter-only-release
  4. branches:
  5. ignore: /.*/
  6. tags:
  7. only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
  8. - &filter-not-release-or-master
  9. tags:
  10. ignore: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
  11. branches:
  12. ignore: master
  13. - &filter-only-master
  14. branches:
  15. only: master
  16. version: 2
  17. jobs:
  18. mysql-integration-test:
  19. docker:
  20. - image: circleci/golang:1.12.9
  21. - image: circleci/mysql:5.6-ram
  22. environment:
  23. MYSQL_ROOT_PASSWORD: rootpass
  24. MYSQL_DATABASE: grafana_tests
  25. MYSQL_USER: grafana
  26. MYSQL_PASSWORD: password
  27. working_directory: /go/src/github.com/grafana/grafana
  28. steps:
  29. - checkout
  30. - run: sudo apt update
  31. - run: sudo apt install -y default-mysql-client
  32. - run: dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
  33. - run: cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h 127.0.0.1 -P 3306 -u root -prootpass
  34. - run:
  35. name: mysql integration tests
  36. command: './scripts/circle-test-mysql.sh'
  37. postgres-integration-test:
  38. docker:
  39. - image: circleci/golang:1.12.9
  40. - image: circleci/postgres:9.3-ram
  41. environment:
  42. POSTGRES_USER: grafanatest
  43. POSTGRES_PASSWORD: grafanatest
  44. POSTGRES_DB: grafanatest
  45. working_directory: /go/src/github.com/grafana/grafana
  46. steps:
  47. - checkout
  48. - run: sudo apt update
  49. - run: sudo apt install -y postgresql-client
  50. - run: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s
  51. - run: 'PGPASSWORD=grafanatest psql -p 5432 -h 127.0.0.1 -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql'
  52. - run:
  53. name: postgres integration tests
  54. command: './scripts/circle-test-postgres.sh'
  55. cache-server-test:
  56. docker:
  57. - image: circleci/golang:1.12.9
  58. - image: circleci/redis:4-alpine
  59. - image: memcached
  60. working_directory: /go/src/github.com/grafana/grafana
  61. steps:
  62. - checkout
  63. - run: dockerize -wait tcp://127.0.0.1:11211 -timeout 120s
  64. - run: dockerize -wait tcp://127.0.0.1:6379 -timeout 120s
  65. - run:
  66. name: cache server tests
  67. command: './scripts/circle-test-cache-servers.sh'
  68. end-to-end-test:
  69. docker:
  70. - image: circleci/node:10-browsers
  71. - image: grafana/grafana-dev:master-$CIRCLE_SHA1
  72. steps:
  73. - run: dockerize -wait tcp://127.0.0.1:3000 -timeout 120s
  74. - checkout
  75. - restore_cache:
  76. key: dependency-cache-{{ checksum "yarn.lock" }}
  77. - run:
  78. name: yarn install
  79. command: 'yarn install --pure-lockfile --no-progress'
  80. no_output_timeout: 5m
  81. - save_cache:
  82. key: dependency-cache-{{ checksum "yarn.lock" }}
  83. paths:
  84. - node_modules
  85. - run:
  86. name: run end-to-end tests
  87. command: 'env BASE_URL=http://127.0.0.1:3000 yarn e2e-tests'
  88. no_output_timeout: 5m
  89. - store_artifacts:
  90. path: public/e2e-test/screenShots/theTruth
  91. destination: expected-screenshots
  92. - store_artifacts:
  93. path: public/e2e-test/screenShots/theOutput
  94. destination: output-screenshots
  95. end-to-end-test-release:
  96. docker:
  97. - image: circleci/node:10-browsers
  98. - image: grafana/grafana-dev:$CIRCLE_TAG
  99. steps:
  100. - run: dockerize -wait tcp://127.0.0.1:3000 -timeout 120s
  101. - checkout
  102. - restore_cache:
  103. key: dependency-cache-{{ checksum "yarn.lock" }}
  104. - run:
  105. name: yarn install
  106. command: 'yarn install --pure-lockfile --no-progress'
  107. no_output_timeout: 5m
  108. - save_cache:
  109. key: dependency-cache-{{ checksum "yarn.lock" }}
  110. paths:
  111. - node_modules
  112. - run:
  113. name: run end-to-end tests
  114. command: 'env BASE_URL=http://127.0.0.1:3000 yarn e2e-tests'
  115. no_output_timeout: 5m
  116. - store_artifacts:
  117. path: public/e2e-test/screenShots/theTruth
  118. destination: expected-screenshots
  119. - store_artifacts:
  120. path: public/e2e-test/screenShots/theOutput
  121. destination: output-screenshots
  122. codespell:
  123. docker:
  124. - image: circleci/python
  125. steps:
  126. - checkout
  127. - run:
  128. name: install codespell
  129. command: 'sudo pip install codespell'
  130. - run:
  131. # Important: all words have to be in lowercase, and separated by "\n".
  132. name: exclude known exceptions
  133. command: 'echo -e "unknwon\nreferer\nerrorstring" > words_to_ignore.txt'
  134. - run:
  135. name: check documentation spelling errors
  136. command: 'codespell -I ./words_to_ignore.txt docs/'
  137. lint-go:
  138. docker:
  139. - image: circleci/golang:1.12.9
  140. environment:
  141. # we need CGO because of go-sqlite3
  142. CGO_ENABLED: 1
  143. working_directory: /go/src/github.com/grafana/grafana
  144. steps:
  145. - checkout
  146. - run:
  147. name: Lint Go
  148. command: 'make lint-go'
  149. shellcheck:
  150. machine: true
  151. working_directory: ~/go/src/github.com/grafana/grafana
  152. steps:
  153. - checkout
  154. - run:
  155. name: ShellCheck
  156. command: 'make shellcheck'
  157. test-frontend:
  158. docker:
  159. - image: circleci/node:10
  160. steps:
  161. - checkout
  162. - restore_cache:
  163. key: dependency-cache-{{ checksum "yarn.lock" }}
  164. - run:
  165. name: yarn install
  166. command: 'yarn install --frozen-lockfile --no-progress'
  167. no_output_timeout: 15m
  168. - save_cache:
  169. key: dependency-cache-{{ checksum "yarn.lock" }}
  170. paths:
  171. - node_modules
  172. - run:
  173. name: frontend tests
  174. command: './scripts/circle-test-frontend.sh'
  175. test-backend:
  176. docker:
  177. - image: circleci/golang:1.12.9
  178. working_directory: /go/src/github.com/grafana/grafana
  179. steps:
  180. - checkout
  181. - run:
  182. name: build backend and run go tests
  183. command: './scripts/circle-test-backend.sh'
  184. build-all:
  185. docker:
  186. - image: grafana/build-container:1.2.8
  187. working_directory: /go/src/github.com/grafana/grafana
  188. steps:
  189. - checkout
  190. - run:
  191. name: prepare build tools
  192. command: '/tmp/bootstrap.sh'
  193. - restore_cache:
  194. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  195. - run:
  196. name: download phantomjs binaries
  197. command: './scripts/build/download-phantomjs.sh'
  198. - save_cache:
  199. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  200. paths:
  201. - /tmp/phantomjs
  202. - run:
  203. name: build and package grafana
  204. command: './scripts/build/build-all.sh'
  205. - run:
  206. name: sign packages
  207. command: './scripts/build/sign_packages.sh'
  208. - run:
  209. name: verify signed packages
  210. command: |
  211. mkdir -p ~/.rpmdb/pubkeys
  212. curl -s https://packages.grafana.com/gpg.key > ~/.rpmdb/pubkeys/grafana.key
  213. ./scripts/build/verify_signed_packages.sh dist/*.rpm
  214. - run:
  215. name: sha-sum packages
  216. command: 'go run build.go sha-dist'
  217. - run:
  218. name: Test and build Grafana.com release publisher
  219. command: 'cd scripts/build/release_publisher && go test . && go build -o release_publisher .'
  220. - persist_to_workspace:
  221. root: .
  222. paths:
  223. - dist/*
  224. - scripts/*.sh
  225. - scripts/build/release_publisher/release_publisher
  226. - scripts/build/publish.sh
  227. build:
  228. docker:
  229. - image: grafana/build-container:1.2.8
  230. working_directory: /go/src/github.com/grafana/grafana
  231. steps:
  232. - checkout
  233. - run:
  234. name: prepare build tools
  235. command: '/tmp/bootstrap.sh'
  236. - run:
  237. name: build and package grafana
  238. command: './scripts/build/build.sh'
  239. - run:
  240. name: sign packages
  241. command: './scripts/build/sign_packages.sh'
  242. - run:
  243. name: sha-sum packages
  244. command: 'go run build.go sha-dist'
  245. - run:
  246. name: Test Grafana.com release publisher
  247. command: 'cd scripts/build/release_publisher && go test .'
  248. - persist_to_workspace:
  249. root: .
  250. paths:
  251. - dist/*
  252. build-fast-backend:
  253. docker:
  254. - image: grafana/build-container:1.2.8
  255. working_directory: /go/src/github.com/grafana/grafana
  256. steps:
  257. - checkout
  258. - run:
  259. name: prepare build tools
  260. command: '/tmp/bootstrap.sh'
  261. - run:
  262. name: build grafana backend
  263. command: './scripts/build/build.sh --fast --backend-only'
  264. - persist_to_workspace:
  265. root: .
  266. paths:
  267. - bin/*
  268. build-fast-frontend:
  269. docker:
  270. - image: grafana/build-container:1.2.8
  271. working_directory: /go/src/github.com/grafana/grafana
  272. steps:
  273. - checkout
  274. - run:
  275. name: prepare build tools
  276. command: '/tmp/bootstrap.sh'
  277. - restore_cache:
  278. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  279. - run:
  280. name: build grafana frontend
  281. command: './scripts/build/build.sh --fast --frontend-only'
  282. - save_cache:
  283. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  284. paths:
  285. - node_modules
  286. - persist_to_workspace:
  287. root: .
  288. paths:
  289. - public/build/*
  290. - tools/phantomjs/*
  291. build-fast-package:
  292. docker:
  293. - image: grafana/build-container:1.2.8
  294. working_directory: /go/src/github.com/grafana/grafana
  295. steps:
  296. - checkout
  297. - attach_workspace:
  298. at: .
  299. - restore_cache:
  300. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  301. - run:
  302. name: prepare build tools
  303. command: '/tmp/bootstrap.sh'
  304. - run:
  305. name: package grafana
  306. command: './scripts/build/build.sh --fast --package-only'
  307. - run:
  308. name: sha-sum packages
  309. command: 'go run build.go sha-dist'
  310. - run:
  311. name: Test Grafana.com release publisher
  312. command: 'cd scripts/build/release_publisher && go test .'
  313. - persist_to_workspace:
  314. root: /go/src/github.com/grafana/grafana
  315. paths:
  316. - dist/*
  317. build-fast-save:
  318. docker:
  319. - image: grafana/build-container:1.2.8
  320. working_directory: /go/src/github.com/grafana/grafana
  321. steps:
  322. - checkout
  323. - attach_workspace:
  324. at: .
  325. - restore_cache:
  326. key: dependency-cache-{{ checksum "yarn.lock" }}
  327. - run:
  328. name: debug cache
  329. command: 'ls -al /go/src/github.com/grafana/grafana/node_modules'
  330. - run:
  331. name: prepare build tools
  332. command: '/tmp/bootstrap.sh'
  333. - run:
  334. name: build grafana backend
  335. command: './scripts/build/build.sh --fast --backend-only'
  336. - run:
  337. name: build grafana frontend
  338. command: './scripts/build/build.sh --fast --frontend-only'
  339. - save_cache:
  340. key: dependency-cache-{{ checksum "yarn.lock" }}
  341. paths:
  342. - /go/src/github.com/grafana/grafana/node_modules
  343. - run:
  344. name: package grafana
  345. command: './scripts/build/build.sh --fast --package-only'
  346. - run:
  347. name: sign packages
  348. command: './scripts/build/sign_packages.sh'
  349. - run:
  350. name: sha-sum packages
  351. command: 'go run build.go sha-dist'
  352. - run:
  353. name: Test Grafana.com release publisher
  354. command: 'cd scripts/build/release_publisher && go test .'
  355. - persist_to_workspace:
  356. root: .
  357. paths:
  358. - dist/*
  359. grafana-docker-master:
  360. machine:
  361. image: circleci/classic:201808-01
  362. steps:
  363. - checkout
  364. - attach_workspace:
  365. at: .
  366. - run: docker info
  367. - run: docker run --privileged linuxkit/binfmt:v0.6
  368. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  369. - run: cd packaging/docker && ./build-deploy.sh "master-${CIRCLE_SHA1}"
  370. - run: rm packaging/docker/grafana-latest.linux-*.tar.gz
  371. - run: cp enterprise-dist/grafana-enterprise-*.linux-amd64.tar.gz packaging/docker/grafana-latest.linux-x64.tar.gz
  372. - run: cd packaging/docker && ./build-enterprise.sh "master"
  373. grafana-docker-pr:
  374. machine:
  375. image: circleci/classic:201808-01
  376. steps:
  377. - checkout
  378. - attach_workspace:
  379. at: .
  380. - run: docker info
  381. - run: docker run --privileged linuxkit/binfmt:v0.6
  382. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  383. - run: cd packaging/docker && ./build.sh --fast "${CIRCLE_SHA1}"
  384. grafana-docker-release:
  385. machine:
  386. image: circleci/classic:201808-01
  387. steps:
  388. - checkout
  389. - attach_workspace:
  390. at: .
  391. - run: docker info
  392. - run: docker run --privileged linuxkit/binfmt:v0.6
  393. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  394. - run: cd packaging/docker && ./build-deploy.sh "${CIRCLE_TAG}"
  395. - run: rm packaging/docker/grafana-latest.linux-*.tar.gz
  396. - run: cp enterprise-dist/grafana-enterprise-*.linux-amd64.tar.gz packaging/docker/grafana-latest.linux-x64.tar.gz
  397. - run: cd packaging/docker && ./build-enterprise.sh "${CIRCLE_TAG}"
  398. build-enterprise:
  399. docker:
  400. - image: grafana/build-container:1.2.8
  401. working_directory: /go/src/github.com/grafana/grafana
  402. steps:
  403. - checkout
  404. - run:
  405. name: prepare build tools
  406. command: '/tmp/bootstrap.sh'
  407. - run:
  408. name: checkout enterprise
  409. command: './scripts/build/prepare-enterprise.sh'
  410. - run:
  411. name: test enterprise
  412. command: 'go test ./pkg/extensions/...'
  413. - run:
  414. name: build and package enterprise
  415. command: './scripts/build/build.sh -enterprise'
  416. - run:
  417. name: sign packages
  418. command: './scripts/build/sign_packages.sh'
  419. - run:
  420. name: sha-sum packages
  421. command: 'go run build.go sha-dist'
  422. - run:
  423. name: move enterprise packages into their own folder
  424. command: 'mv dist enterprise-dist'
  425. - persist_to_workspace:
  426. root: .
  427. paths:
  428. - enterprise-dist/*
  429. build-all-enterprise:
  430. docker:
  431. - image: grafana/build-container:1.2.8
  432. working_directory: /go/src/github.com/grafana/grafana
  433. steps:
  434. - checkout
  435. - run:
  436. name: prepare build tools
  437. command: '/tmp/bootstrap.sh'
  438. - run:
  439. name: checkout enterprise
  440. command: './scripts/build/prepare-enterprise.sh'
  441. - restore_cache:
  442. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  443. - run:
  444. name: download phantomjs binaries
  445. command: './scripts/build/download-phantomjs.sh'
  446. - save_cache:
  447. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  448. paths:
  449. - /tmp/phantomjs
  450. - run:
  451. name: test enterprise
  452. command: 'go test ./pkg/extensions/...'
  453. - run:
  454. name: build and package grafana
  455. command: './scripts/build/build-all.sh -enterprise'
  456. - run:
  457. name: sign packages
  458. command: './scripts/build/sign_packages.sh'
  459. - run:
  460. name: verify signed packages
  461. command: |
  462. mkdir -p ~/.rpmdb/pubkeys
  463. curl -s https://packages.grafana.com/gpg.key > ~/.rpmdb/pubkeys/grafana.key
  464. ./scripts/build/verify_signed_packages.sh dist/*.rpm
  465. - run:
  466. name: sha-sum packages
  467. command: 'go run build.go sha-dist'
  468. - run:
  469. name: move enterprise packages into their own folder
  470. command: 'mv dist enterprise-dist'
  471. - persist_to_workspace:
  472. root: .
  473. paths:
  474. - enterprise-dist/*
  475. deploy-enterprise-master:
  476. docker:
  477. - image: grafana/grafana-ci-deploy:1.2.2
  478. steps:
  479. - attach_workspace:
  480. at: .
  481. - run:
  482. name: gcp credentials
  483. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  484. - run:
  485. name: sign in to gcp
  486. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  487. - run:
  488. name: deploy to gcp
  489. command: '/opt/google-cloud-sdk/bin/gsutil cp ./enterprise-dist/* gs://$GCP_BUCKET_NAME/enterprise/master'
  490. - run:
  491. name: Deploy to grafana.com
  492. command: |
  493. cd enterprise-dist
  494. ../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -enterprise -version "v$(cat grafana.version)" --nightly
  495. deploy-enterprise-release:
  496. docker:
  497. - image: grafana/grafana-ci-deploy:1.2.2
  498. steps:
  499. - checkout
  500. - attach_workspace:
  501. at: .
  502. - run:
  503. name: gcp credentials
  504. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  505. - run:
  506. name: sign in to gcp
  507. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  508. - run:
  509. name: deploy to gcp
  510. command: '/opt/google-cloud-sdk/bin/gsutil cp ./enterprise-dist/* gs://$GCP_BUCKET_NAME/enterprise/release'
  511. - run:
  512. name: Deploy to Grafana.com
  513. command: './scripts/build/publish.sh --enterprise'
  514. - run:
  515. name: Load GPG private key
  516. command: './scripts/build/load-signing-key.sh'
  517. - run:
  518. name: Update Debian repository
  519. command: './scripts/build/update_repo/update-deb.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "enterprise-dist"'
  520. - run:
  521. name: Update RPM repository
  522. command: './scripts/build/update_repo/update-rpm.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "enterprise-dist"'
  523. deploy-master:
  524. docker:
  525. - image: grafana/grafana-ci-deploy:1.2.2
  526. steps:
  527. - attach_workspace:
  528. at: .
  529. - run:
  530. name: Trigger Windows build
  531. command: './scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master'
  532. - run:
  533. name: gcp credentials
  534. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  535. - run:
  536. name: sign in to gcp
  537. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  538. - run:
  539. name: deploy to gcp
  540. command: '/opt/google-cloud-sdk/bin/gsutil cp ./dist/* gs://$GCP_BUCKET_NAME/oss/master'
  541. - run:
  542. name: Publish to Grafana.com
  543. command: |
  544. rm dist/*latest* || true
  545. cd dist && ../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -version "v$(cat grafana.version)" --nightly
  546. deploy-release:
  547. docker:
  548. - image: grafana/grafana-ci-deploy:1.2.2
  549. steps:
  550. - checkout
  551. - attach_workspace:
  552. at: .
  553. - run:
  554. name: gcp credentials
  555. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  556. - run:
  557. name: sign in to gcp
  558. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  559. - run:
  560. name: deploy to gcp
  561. command: '/opt/google-cloud-sdk/bin/gsutil cp ./dist/* gs://$GCP_BUCKET_NAME/oss/release'
  562. - run:
  563. name: Deploy to Grafana.com
  564. command: './scripts/build/publish.sh'
  565. - run:
  566. name: Load GPG private key
  567. command: './scripts/build/load-signing-key.sh'
  568. - run:
  569. name: Update Debian repository
  570. command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "dist"'
  571. - run:
  572. name: Update RPM repository
  573. command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "dist"'
  574. build-oss-msi:
  575. docker:
  576. - image: grafana/wix-toolset-ci:v3
  577. steps:
  578. - checkout
  579. - attach_workspace:
  580. at: .
  581. - run:
  582. name: Build OSS MSI
  583. command: './scripts/build/ci-msi-build/ci-msi-build-oss.sh'
  584. - persist_to_workspace:
  585. root: .
  586. paths:
  587. - dist/grafana-*.msi
  588. - dist/grafana-*.msi.sha256
  589. store-build-artifacts:
  590. docker:
  591. - image: circleci/node:10
  592. steps:
  593. - attach_workspace:
  594. at: .
  595. - store_artifacts:
  596. path: ./dist
  597. trigger-docs-update:
  598. docker:
  599. - image: circleci/python:3.6.8
  600. steps:
  601. - checkout
  602. - run:
  603. name: Trigger Docs update
  604. command: |
  605. if git diff --name-only HEAD^ | grep -q "^docs"; then
  606. echo "Build URL:"
  607. curl -s -u "$DOCS_CIRCLE_TOKEN:" \
  608. -d build_parameters[CIRCLE_JOB]=pull-submodule-changes \
  609. https://circleci.com/api/v1.1/project/github/grafana/docs.grafana.com/tree/master \
  610. | jq .build_url
  611. else
  612. echo "-- no changes to docs files --"
  613. fi
  614. build-grafana-packages:
  615. docker:
  616. - image: circleci/node:10
  617. steps:
  618. - checkout
  619. - run:
  620. name: Boostrap lerna
  621. command: 'npx lerna bootstrap'
  622. - run:
  623. name: Build packages
  624. command: yarn packages:build
  625. release-next-packages:
  626. docker:
  627. - image: circleci/node:10
  628. steps:
  629. - checkout
  630. - run:
  631. name: Boostrap lerna
  632. command: 'npx lerna bootstrap'
  633. - run:
  634. name: npm - Prepare auth token
  635. command: 'echo //registry.npmjs.org/:_authToken=$NPM_TOKEN >> ~/.npmrc'
  636. - run:
  637. name: Release next packages
  638. command: './scripts/circle-release-next-packages.sh'
  639. workflows:
  640. version: 2
  641. build-master:
  642. jobs:
  643. - build-all:
  644. filters: *filter-only-master
  645. - build-all-enterprise:
  646. filters: *filter-only-master
  647. - codespell:
  648. filters: *filter-only-master
  649. - lint-go:
  650. filters: *filter-only-master
  651. - shellcheck:
  652. filters: *filter-only-master
  653. - test-frontend:
  654. filters: *filter-only-master
  655. - test-backend:
  656. filters: *filter-only-master
  657. - mysql-integration-test:
  658. filters: *filter-only-master
  659. - postgres-integration-test:
  660. filters: *filter-only-master
  661. - deploy-master:
  662. requires:
  663. - build-all
  664. - test-backend
  665. - test-frontend
  666. - codespell
  667. - lint-go
  668. - shellcheck
  669. - mysql-integration-test
  670. - postgres-integration-test
  671. - build-oss-msi
  672. filters: *filter-only-master
  673. - grafana-docker-master:
  674. requires:
  675. - build-all
  676. - build-all-enterprise
  677. - test-backend
  678. - test-frontend
  679. - codespell
  680. - lint-go
  681. - shellcheck
  682. - mysql-integration-test
  683. - postgres-integration-test
  684. filters: *filter-only-master
  685. - deploy-enterprise-master:
  686. requires:
  687. - build-all
  688. - test-backend
  689. - test-frontend
  690. - codespell
  691. - lint-go
  692. - shellcheck
  693. - mysql-integration-test
  694. - postgres-integration-test
  695. - build-all-enterprise
  696. filters: *filter-only-master
  697. - build-oss-msi:
  698. requires:
  699. - build-all
  700. - test-backend
  701. - test-frontend
  702. - codespell
  703. - lint-go
  704. - shellcheck
  705. - mysql-integration-test
  706. - postgres-integration-test
  707. filters: *filter-only-master
  708. - end-to-end-test:
  709. requires:
  710. - grafana-docker-master
  711. filters: *filter-only-master
  712. - trigger-docs-update:
  713. requires:
  714. - end-to-end-test
  715. filters: *filter-only-master
  716. - release-next-packages:
  717. requires:
  718. - build-all
  719. - test-frontend
  720. filters: *filter-only-master
  721. release:
  722. jobs:
  723. - build-all:
  724. filters: *filter-only-release
  725. - build-all-enterprise:
  726. filters: *filter-only-release
  727. - codespell:
  728. filters: *filter-only-release
  729. - lint-go:
  730. filters: *filter-only-release
  731. - shellcheck:
  732. filters: *filter-only-release
  733. - test-frontend:
  734. filters: *filter-only-release
  735. - test-backend:
  736. filters: *filter-only-release
  737. - mysql-integration-test:
  738. filters: *filter-only-release
  739. - postgres-integration-test:
  740. filters: *filter-only-release
  741. - deploy-release:
  742. requires:
  743. - build-all
  744. - test-backend
  745. - test-frontend
  746. - codespell
  747. - lint-go
  748. - shellcheck
  749. - mysql-integration-test
  750. - postgres-integration-test
  751. - build-oss-msi
  752. filters: *filter-only-release
  753. - deploy-enterprise-release:
  754. requires:
  755. - build-all
  756. - build-all-enterprise
  757. - test-backend
  758. - test-frontend
  759. - codespell
  760. - lint-go
  761. - shellcheck
  762. - mysql-integration-test
  763. - postgres-integration-test
  764. filters: *filter-only-release
  765. - grafana-docker-release:
  766. requires:
  767. - build-all
  768. - build-all-enterprise
  769. - test-backend
  770. - test-frontend
  771. - codespell
  772. - lint-go
  773. - shellcheck
  774. - mysql-integration-test
  775. - postgres-integration-test
  776. filters: *filter-only-release
  777. - build-oss-msi:
  778. requires:
  779. - build-all
  780. - test-backend
  781. - test-frontend
  782. - codespell
  783. - lint-go
  784. - shellcheck
  785. - mysql-integration-test
  786. - postgres-integration-test
  787. filters: *filter-only-release
  788. - end-to-end-test-release:
  789. requires:
  790. - grafana-docker-release
  791. filters: *filter-only-release
  792. build-branches-and-prs:
  793. jobs:
  794. - build-fast-backend:
  795. filters: *filter-not-release-or-master
  796. - build-fast-frontend:
  797. filters: *filter-not-release-or-master
  798. - build-grafana-packages:
  799. filters: *filter-not-release-or-master
  800. - build-fast-package:
  801. filters: *filter-not-release-or-master
  802. requires:
  803. - build-fast-backend
  804. - build-fast-frontend
  805. - codespell:
  806. filters: *filter-not-release-or-master
  807. - lint-go:
  808. filters: *filter-not-release-or-master
  809. - lint-go:
  810. filters: *filter-not-release-or-master
  811. - shellcheck:
  812. filters: *filter-not-release-or-master
  813. - test-frontend:
  814. filters: *filter-not-release-or-master
  815. - test-backend:
  816. filters: *filter-not-release-or-master
  817. - mysql-integration-test:
  818. filters: *filter-not-release-or-master
  819. - postgres-integration-test:
  820. filters: *filter-not-release-or-master
  821. - cache-server-test:
  822. filters: *filter-not-release-or-master
  823. - grafana-docker-pr:
  824. requires:
  825. - build-fast-package
  826. - test-backend
  827. - test-frontend
  828. - codespell
  829. - lint-go
  830. - shellcheck
  831. - mysql-integration-test
  832. - postgres-integration-test
  833. - cache-server-test
  834. filters: *filter-not-release-or-master
  835. - store-build-artifacts:
  836. requires:
  837. - build-fast-package
  838. - test-backend
  839. - test-frontend
  840. - codespell
  841. - lint-go
  842. - shellcheck
  843. - mysql-integration-test
  844. - postgres-integration-test
  845. - cache-server-test
  846. filters: *filter-not-release-or-master