config.yml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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.6
  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 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.6
  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.6
  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. codespell:
  96. docker:
  97. - image: circleci/python
  98. steps:
  99. - checkout
  100. - run:
  101. name: install codespell
  102. command: 'sudo pip install codespell'
  103. - run:
  104. # Important: all words have to be in lowercase, and separated by "\n".
  105. name: exclude known exceptions
  106. command: 'echo -e "unknwon\nreferer\nerrorstring" > words_to_ignore.txt'
  107. - run:
  108. name: check documentation spelling errors
  109. command: 'codespell -I ./words_to_ignore.txt docs/'
  110. lint-go:
  111. docker:
  112. - image: circleci/golang:1.12.6
  113. environment:
  114. # we need CGO because of go-sqlite3
  115. CGO_ENABLED: 1
  116. working_directory: /go/src/github.com/grafana/grafana
  117. steps:
  118. - checkout
  119. - run:
  120. name: Lint Go
  121. command: 'make lint-go'
  122. test-frontend:
  123. docker:
  124. - image: circleci/node:10
  125. steps:
  126. - checkout
  127. - restore_cache:
  128. key: dependency-cache-{{ checksum "yarn.lock" }}
  129. - run:
  130. name: yarn install
  131. command: 'yarn install --pure-lockfile --no-progress'
  132. no_output_timeout: 15m
  133. - save_cache:
  134. key: dependency-cache-{{ checksum "yarn.lock" }}
  135. paths:
  136. - node_modules
  137. - run:
  138. name: frontend tests
  139. command: './scripts/circle-test-frontend.sh'
  140. test-backend:
  141. docker:
  142. - image: circleci/golang:1.12.6
  143. working_directory: /go/src/github.com/grafana/grafana
  144. steps:
  145. - checkout
  146. - run:
  147. name: build backend and run go tests
  148. command: './scripts/circle-test-backend.sh'
  149. build-all:
  150. docker:
  151. - image: grafana/build-container:1.2.7
  152. working_directory: /go/src/github.com/grafana/grafana
  153. steps:
  154. - checkout
  155. - run:
  156. name: prepare build tools
  157. command: '/tmp/bootstrap.sh'
  158. - restore_cache:
  159. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  160. - run:
  161. name: download phantomjs binaries
  162. command: './scripts/build/download-phantomjs.sh'
  163. - save_cache:
  164. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  165. paths:
  166. - /tmp/phantomjs
  167. - run:
  168. name: build and package grafana
  169. command: './scripts/build/build-all.sh'
  170. - run:
  171. name: sign packages
  172. command: './scripts/build/sign_packages.sh'
  173. - run:
  174. name: verify signed packages
  175. command: |
  176. mkdir -p ~/.rpmdb/pubkeys
  177. curl -s https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana > ~/.rpmdb/pubkeys/grafana.key
  178. ./scripts/build/verify_signed_packages.sh dist/*.rpm
  179. - run:
  180. name: sha-sum packages
  181. command: 'go run build.go sha-dist'
  182. - run:
  183. name: Test and build Grafana.com release publisher
  184. command: 'cd scripts/build/release_publisher && go test . && go build -o release_publisher .'
  185. - persist_to_workspace:
  186. root: .
  187. paths:
  188. - dist/*
  189. - scripts/*.sh
  190. - scripts/build/release_publisher/release_publisher
  191. - scripts/build/publish.sh
  192. build:
  193. docker:
  194. - image: grafana/build-container:1.2.7
  195. working_directory: /go/src/github.com/grafana/grafana
  196. steps:
  197. - checkout
  198. - run:
  199. name: prepare build tools
  200. command: '/tmp/bootstrap.sh'
  201. - run:
  202. name: build and package grafana
  203. command: './scripts/build/build.sh'
  204. - run:
  205. name: sign packages
  206. command: './scripts/build/sign_packages.sh'
  207. - run:
  208. name: sha-sum packages
  209. command: 'go run build.go sha-dist'
  210. - run:
  211. name: Test Grafana.com release publisher
  212. command: 'cd scripts/build/release_publisher && go test .'
  213. - persist_to_workspace:
  214. root: .
  215. paths:
  216. - dist/*
  217. build-fast-backend:
  218. docker:
  219. - image: grafana/build-container:1.2.7
  220. working_directory: /go/src/github.com/grafana/grafana
  221. steps:
  222. - checkout
  223. - run:
  224. name: prepare build tools
  225. command: '/tmp/bootstrap.sh'
  226. - run:
  227. name: build grafana backend
  228. command: './scripts/build/build.sh --fast --backend-only'
  229. - persist_to_workspace:
  230. root: .
  231. paths:
  232. - bin/*
  233. build-fast-frontend:
  234. docker:
  235. - image: grafana/build-container:1.2.7
  236. working_directory: /go/src/github.com/grafana/grafana
  237. steps:
  238. - checkout
  239. - run:
  240. name: prepare build tools
  241. command: '/tmp/bootstrap.sh'
  242. - restore_cache:
  243. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  244. - run:
  245. name: build grafana frontend
  246. command: './scripts/build/build.sh --fast --frontend-only'
  247. - save_cache:
  248. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  249. paths:
  250. - node_modules
  251. - persist_to_workspace:
  252. root: .
  253. paths:
  254. - public/build/*
  255. - tools/phantomjs/*
  256. build-fast-package:
  257. docker:
  258. - image: grafana/build-container:1.2.7
  259. working_directory: /go/src/github.com/grafana/grafana
  260. steps:
  261. - checkout
  262. - attach_workspace:
  263. at: .
  264. - restore_cache:
  265. key: frontend-dependency-cache-{{ checksum "yarn.lock" }}
  266. - run:
  267. name: prepare build tools
  268. command: '/tmp/bootstrap.sh'
  269. - run:
  270. name: package grafana
  271. command: './scripts/build/build.sh --fast --package-only'
  272. - run:
  273. name: sha-sum packages
  274. command: 'go run build.go sha-dist'
  275. - run:
  276. name: Test Grafana.com release publisher
  277. command: 'cd scripts/build/release_publisher && go test .'
  278. - persist_to_workspace:
  279. root: /go/src/github.com/grafana/grafana
  280. paths:
  281. - dist/*
  282. build-fast-save:
  283. docker:
  284. - image: grafana/build-container:1.2.7
  285. working_directory: /go/src/github.com/grafana/grafana
  286. steps:
  287. - checkout
  288. - attach_workspace:
  289. at: .
  290. - restore_cache:
  291. key: dependency-cache-{{ checksum "yarn.lock" }}
  292. - run:
  293. name: debug cache
  294. command: 'ls -al /go/src/github.com/grafana/grafana/node_modules'
  295. - run:
  296. name: prepare build tools
  297. command: '/tmp/bootstrap.sh'
  298. - run:
  299. name: build grafana backend
  300. command: './scripts/build/build.sh --fast --backend-only'
  301. - run:
  302. name: build grafana frontend
  303. command: './scripts/build/build.sh --fast --frontend-only'
  304. - save_cache:
  305. key: dependency-cache-{{ checksum "yarn.lock" }}
  306. paths:
  307. - /go/src/github.com/grafana/grafana/node_modules
  308. - run:
  309. name: package grafana
  310. command: './scripts/build/build.sh --fast --package-only'
  311. - run:
  312. name: sign packages
  313. command: './scripts/build/sign_packages.sh'
  314. - run:
  315. name: sha-sum packages
  316. command: 'go run build.go sha-dist'
  317. - run:
  318. name: Test Grafana.com release publisher
  319. command: 'cd scripts/build/release_publisher && go test .'
  320. - persist_to_workspace:
  321. root: .
  322. paths:
  323. - dist/*
  324. grafana-docker-master:
  325. machine:
  326. image: circleci/classic:201808-01
  327. steps:
  328. - checkout
  329. - attach_workspace:
  330. at: .
  331. - run: docker info
  332. - run: docker run --privileged linuxkit/binfmt:v0.6
  333. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  334. - run: cd packaging/docker && ./build-deploy.sh "master-${CIRCLE_SHA1}"
  335. - run: rm packaging/docker/grafana-latest.linux-*.tar.gz
  336. - run: cp enterprise-dist/grafana-enterprise-*.linux-amd64.tar.gz packaging/docker/grafana-latest.linux-x64.tar.gz
  337. - run: cd packaging/docker && ./build-enterprise.sh "master"
  338. grafana-docker-pr:
  339. machine:
  340. image: circleci/classic:201808-01
  341. steps:
  342. - checkout
  343. - attach_workspace:
  344. at: .
  345. - run: docker info
  346. - run: docker run --privileged linuxkit/binfmt:v0.6
  347. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  348. - run: cd packaging/docker && ./build.sh --fast "${CIRCLE_SHA1}"
  349. grafana-docker-release:
  350. machine:
  351. image: circleci/classic:201808-01
  352. steps:
  353. - checkout
  354. - attach_workspace:
  355. at: .
  356. - run: docker info
  357. - run: docker run --privileged linuxkit/binfmt:v0.6
  358. - run: cp dist/grafana-latest.linux-*.tar.gz packaging/docker
  359. - run: cd packaging/docker && ./build-deploy.sh "${CIRCLE_TAG}"
  360. - run: rm packaging/docker/grafana-latest.linux-*.tar.gz
  361. - run: cp enterprise-dist/grafana-enterprise-*.linux-amd64.tar.gz packaging/docker/grafana-latest.linux-x64.tar.gz
  362. - run: cd packaging/docker && ./build-enterprise.sh "${CIRCLE_TAG}"
  363. build-enterprise:
  364. docker:
  365. - image: grafana/build-container:1.2.7
  366. working_directory: /go/src/github.com/grafana/grafana
  367. steps:
  368. - checkout
  369. - run:
  370. name: prepare build tools
  371. command: '/tmp/bootstrap.sh'
  372. - run:
  373. name: checkout enterprise
  374. command: './scripts/build/prepare-enterprise.sh'
  375. - run:
  376. name: test enterprise
  377. command: 'go test ./pkg/extensions/...'
  378. - run:
  379. name: build and package enterprise
  380. command: './scripts/build/build.sh -enterprise'
  381. - run:
  382. name: sign packages
  383. command: './scripts/build/sign_packages.sh'
  384. - run:
  385. name: sha-sum packages
  386. command: 'go run build.go sha-dist'
  387. - run:
  388. name: move enterprise packages into their own folder
  389. command: 'mv dist enterprise-dist'
  390. - persist_to_workspace:
  391. root: .
  392. paths:
  393. - enterprise-dist/*
  394. build-all-enterprise:
  395. docker:
  396. - image: grafana/build-container:1.2.7
  397. working_directory: /go/src/github.com/grafana/grafana
  398. steps:
  399. - checkout
  400. - run:
  401. name: prepare build tools
  402. command: '/tmp/bootstrap.sh'
  403. - run:
  404. name: checkout enterprise
  405. command: './scripts/build/prepare-enterprise.sh'
  406. - restore_cache:
  407. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  408. - run:
  409. name: download phantomjs binaries
  410. command: './scripts/build/download-phantomjs.sh'
  411. - save_cache:
  412. key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
  413. paths:
  414. - /tmp/phantomjs
  415. - run:
  416. name: test enterprise
  417. command: 'go test ./pkg/extensions/...'
  418. - run:
  419. name: build and package grafana
  420. command: './scripts/build/build-all.sh -enterprise'
  421. - run:
  422. name: sign packages
  423. command: './scripts/build/sign_packages.sh'
  424. - run:
  425. name: verify signed packages
  426. command: |
  427. mkdir -p ~/.rpmdb/pubkeys
  428. curl -s https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana > ~/.rpmdb/pubkeys/grafana.key
  429. ./scripts/build/verify_signed_packages.sh dist/*.rpm
  430. - run:
  431. name: sha-sum packages
  432. command: 'go run build.go sha-dist'
  433. - run:
  434. name: move enterprise packages into their own folder
  435. command: 'mv dist enterprise-dist'
  436. - persist_to_workspace:
  437. root: .
  438. paths:
  439. - enterprise-dist/*
  440. deploy-enterprise-master:
  441. docker:
  442. - image: grafana/grafana-ci-deploy:1.2.2
  443. steps:
  444. - attach_workspace:
  445. at: .
  446. - run:
  447. name: gcp credentials
  448. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  449. - run:
  450. name: sign in to gcp
  451. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  452. - run:
  453. name: deploy to s3
  454. command: 'aws s3 sync ./enterprise-dist s3://$ENTERPRISE_BUCKET_NAME/master'
  455. - run:
  456. name: deploy to gcp
  457. command: '/opt/google-cloud-sdk/bin/gsutil cp ./enterprise-dist/* gs://$GCP_BUCKET_NAME/enterprise/master'
  458. - run:
  459. name: Deploy to grafana.com
  460. command: |
  461. cd enterprise-dist
  462. ../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -enterprise -version "v$(cat grafana.version)" --nightly
  463. deploy-enterprise-release:
  464. docker:
  465. - image: grafana/grafana-ci-deploy:1.2.2
  466. steps:
  467. - checkout
  468. - attach_workspace:
  469. at: .
  470. - run:
  471. name: gcp credentials
  472. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  473. - run:
  474. name: sign in to gcp
  475. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  476. - run:
  477. name: deploy to s3
  478. command: 'aws s3 sync ./enterprise-dist s3://$ENTERPRISE_BUCKET_NAME/release'
  479. - run:
  480. name: deploy to gcp
  481. command: '/opt/google-cloud-sdk/bin/gsutil cp ./enterprise-dist/* gs://$GCP_BUCKET_NAME/enterprise/release'
  482. - run:
  483. name: Deploy to Grafana.com
  484. command: './scripts/build/publish.sh --enterprise'
  485. - run:
  486. name: Load GPG private key
  487. command: './scripts/build/load-signing-key.sh'
  488. - run:
  489. name: Update Debian repository
  490. command: './scripts/build/update_repo/update-deb.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "enterprise-dist"'
  491. - run:
  492. name: Update RPM repository
  493. command: './scripts/build/update_repo/update-rpm.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "enterprise-dist"'
  494. deploy-master:
  495. docker:
  496. - image: grafana/grafana-ci-deploy:1.2.2
  497. steps:
  498. - attach_workspace:
  499. at: .
  500. - run:
  501. name: deploy to s3
  502. command: |
  503. # Also
  504. cp dist/grafana-latest.linux-x64.tar.gz dist/grafana-master-$(echo "${CIRCLE_SHA1}" | cut -b1-7).linux-x64.tar.gz
  505. aws s3 sync ./dist s3://$BUCKET_NAME/master
  506. - run:
  507. name: Trigger Windows build
  508. command: './scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master'
  509. - run:
  510. name: gcp credentials
  511. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  512. - run:
  513. name: sign in to gcp
  514. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  515. - run:
  516. name: deploy to gcp
  517. command: '/opt/google-cloud-sdk/bin/gsutil cp ./dist/* gs://$GCP_BUCKET_NAME/oss/master'
  518. - run:
  519. name: Publish to Grafana.com
  520. command: |
  521. rm dist/grafana-master-$(echo "${CIRCLE_SHA1}" | cut -b1-7).linux-x64.tar.gz
  522. rm dist/*latest*
  523. cd dist && ../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -version "v$(cat grafana.version)" --nightly
  524. deploy-release:
  525. docker:
  526. - image: grafana/grafana-ci-deploy:1.2.2
  527. steps:
  528. - checkout
  529. - attach_workspace:
  530. at: .
  531. - run:
  532. name: deploy to s3
  533. command: 'aws s3 sync ./dist s3://$BUCKET_NAME/release'
  534. - run:
  535. name: gcp credentials
  536. command: 'echo ${GCP_GRAFANA_UPLOAD_KEY} > /tmp/gcpkey.json'
  537. - run:
  538. name: sign in to gcp
  539. command: '/opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json'
  540. - run:
  541. name: deploy to gcp
  542. command: '/opt/google-cloud-sdk/bin/gsutil cp ./dist/* gs://$GCP_BUCKET_NAME/oss/release'
  543. - run:
  544. name: Deploy to Grafana.com
  545. command: './scripts/build/publish.sh'
  546. - run:
  547. name: Load GPG private key
  548. command: './scripts/build/load-signing-key.sh'
  549. - run:
  550. name: Update Debian repository
  551. command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "dist"'
  552. - run:
  553. name: Update RPM repository
  554. command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG" "dist"'
  555. build-oss-msi:
  556. docker:
  557. - image: grafana/wix-toolset-ci:v3
  558. steps:
  559. - checkout
  560. - attach_workspace:
  561. at: .
  562. - run:
  563. name: Build OSS MSI
  564. command: './scripts/build/ci-msi-build/ci-msi-build-oss.sh'
  565. - persist_to_workspace:
  566. root: .
  567. paths:
  568. - dist/grafana-*.msi
  569. - dist/grafana-*.msi.sha256
  570. store-build-artifacts:
  571. docker:
  572. - image: circleci/node:8
  573. steps:
  574. - attach_workspace:
  575. at: .
  576. - store_artifacts:
  577. path: ./dist
  578. trigger-docs-update:
  579. docker:
  580. - image: circleci/python:3.6.8
  581. steps:
  582. - checkout
  583. - run:
  584. name: Trigger Docs update
  585. command: |
  586. if git diff --name-only HEAD^ | grep -q "^docs"; then
  587. echo "Build URL:"
  588. curl -s -u "$DOCS_CIRCLE_TOKEN:" \
  589. -d build_parameters[CIRCLE_JOB]=pull-submodule-changes \
  590. https://circleci.com/api/v1.1/project/github/grafana/docs.grafana.com/tree/staging \
  591. | jq .build_url
  592. else
  593. echo "-- no changes to docs files --"
  594. fi
  595. workflows:
  596. version: 2
  597. build-master:
  598. jobs:
  599. - build-all:
  600. filters: *filter-only-master
  601. - build-all-enterprise:
  602. filters: *filter-only-master
  603. - codespell:
  604. filters: *filter-only-master
  605. - lint-go:
  606. filters: *filter-only-master
  607. - test-frontend:
  608. filters: *filter-only-master
  609. - test-backend:
  610. filters: *filter-only-master
  611. - mysql-integration-test:
  612. filters: *filter-only-master
  613. - postgres-integration-test:
  614. filters: *filter-only-master
  615. - deploy-master:
  616. requires:
  617. - build-all
  618. - test-backend
  619. - test-frontend
  620. - codespell
  621. - lint-go
  622. - mysql-integration-test
  623. - postgres-integration-test
  624. - build-oss-msi
  625. filters: *filter-only-master
  626. - grafana-docker-master:
  627. requires:
  628. - build-all
  629. - build-all-enterprise
  630. - test-backend
  631. - test-frontend
  632. - codespell
  633. - lint-go
  634. - mysql-integration-test
  635. - postgres-integration-test
  636. filters: *filter-only-master
  637. - deploy-enterprise-master:
  638. requires:
  639. - build-all
  640. - test-backend
  641. - test-frontend
  642. - codespell
  643. - lint-go
  644. - mysql-integration-test
  645. - postgres-integration-test
  646. - build-all-enterprise
  647. filters: *filter-only-master
  648. - build-oss-msi:
  649. requires:
  650. - build-all
  651. - test-backend
  652. - test-frontend
  653. - codespell
  654. - lint-go
  655. - mysql-integration-test
  656. - postgres-integration-test
  657. filters: *filter-only-master
  658. - end-to-end-test:
  659. requires:
  660. - grafana-docker-master
  661. filters: *filter-only-master
  662. - trigger-docs-update:
  663. requires:
  664. - end-to-end-test
  665. filters: *filter-only-master
  666. release:
  667. jobs:
  668. - build-all:
  669. filters: *filter-only-release
  670. - build-all-enterprise:
  671. filters: *filter-only-release
  672. - codespell:
  673. filters: *filter-only-release
  674. - lint-go:
  675. filters: *filter-only-release
  676. - test-frontend:
  677. filters: *filter-only-release
  678. - test-backend:
  679. filters: *filter-only-release
  680. - mysql-integration-test:
  681. filters: *filter-only-release
  682. - postgres-integration-test:
  683. filters: *filter-only-release
  684. - deploy-release:
  685. requires:
  686. - build-all
  687. - test-backend
  688. - test-frontend
  689. - codespell
  690. - lint-go
  691. - mysql-integration-test
  692. - postgres-integration-test
  693. - build-oss-msi
  694. filters: *filter-only-release
  695. - deploy-enterprise-release:
  696. requires:
  697. - build-all
  698. - build-all-enterprise
  699. - test-backend
  700. - test-frontend
  701. - codespell
  702. - lint-go
  703. - mysql-integration-test
  704. - postgres-integration-test
  705. filters: *filter-only-release
  706. - grafana-docker-release:
  707. requires:
  708. - build-all
  709. - build-all-enterprise
  710. - test-backend
  711. - test-frontend
  712. - codespell
  713. - lint-go
  714. - mysql-integration-test
  715. - postgres-integration-test
  716. filters: *filter-only-release
  717. - build-oss-msi:
  718. requires:
  719. - build-all
  720. - test-backend
  721. - test-frontend
  722. - codespell
  723. - lint-go
  724. - mysql-integration-test
  725. - postgres-integration-test
  726. filters: *filter-only-release
  727. build-branches-and-prs:
  728. jobs:
  729. - build-fast-backend:
  730. filters: *filter-not-release-or-master
  731. - build-fast-frontend:
  732. filters: *filter-not-release-or-master
  733. - build-fast-package:
  734. filters: *filter-not-release-or-master
  735. requires:
  736. - build-fast-backend
  737. - build-fast-frontend
  738. - codespell:
  739. filters: *filter-not-release-or-master
  740. - lint-go:
  741. filters: *filter-not-release-or-master
  742. - test-frontend:
  743. filters: *filter-not-release-or-master
  744. - test-backend:
  745. filters: *filter-not-release-or-master
  746. - mysql-integration-test:
  747. filters: *filter-not-release-or-master
  748. - postgres-integration-test:
  749. filters: *filter-not-release-or-master
  750. - cache-server-test:
  751. filters: *filter-not-release-or-master
  752. - grafana-docker-pr:
  753. requires:
  754. - build-fast-package
  755. - test-backend
  756. - test-frontend
  757. - codespell
  758. - lint-go
  759. - mysql-integration-test
  760. - postgres-integration-test
  761. - cache-server-test
  762. filters: *filter-not-release-or-master
  763. - store-build-artifacts:
  764. requires:
  765. - build-fast-package
  766. - test-backend
  767. - test-frontend
  768. - codespell
  769. - lint-go
  770. - mysql-integration-test
  771. - postgres-integration-test
  772. - cache-server-test
  773. filters: *filter-not-release-or-master