2018-04-21 05:35:53 +00:00
|
|
|
---
|
2018-10-09 12:24:36 +00:00
|
|
|
version: 2.1
|
2018-04-21 05:35:53 +00:00
|
|
|
|
2019-07-15 07:41:28 +00:00
|
|
|
orbs:
|
2021-03-20 17:10:04 +00:00
|
|
|
prometheus: prometheus/prometheus@0.11.0
|
2019-10-24 08:43:22 +00:00
|
|
|
go: circleci/go@0.2.0
|
2020-01-04 14:55:02 +00:00
|
|
|
win: circleci/windows@2.3.0
|
2019-07-15 07:41:28 +00:00
|
|
|
|
2018-10-16 07:41:45 +00:00
|
|
|
executors:
|
2019-11-25 13:59:26 +00:00
|
|
|
# Whenever the Go version is updated here, .promu.yml
|
2018-10-16 07:41:45 +00:00
|
|
|
# should also be updated.
|
|
|
|
golang:
|
2021-02-25 21:25:25 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.16-node
|
|
|
|
golang_115:
|
2018-04-21 05:35:53 +00:00
|
|
|
docker:
|
2020-08-15 21:49:11 +00:00
|
|
|
- image: circleci/golang:1.15-node
|
2018-10-16 07:41:45 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
executor: golang
|
2018-04-21 05:35:53 +00:00
|
|
|
|
|
|
|
steps:
|
2019-07-15 07:41:28 +00:00
|
|
|
- prometheus/setup_environment
|
2019-10-24 08:43:22 +00:00
|
|
|
- go/load-cache:
|
|
|
|
key: v1
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-08-04 21:31:59 +00:00
|
|
|
- v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
|
|
|
- v3-npm-deps-
|
2019-05-03 13:11:28 +00:00
|
|
|
- run:
|
2019-07-15 09:20:08 +00:00
|
|
|
command: make
|
2019-05-03 13:11:28 +00:00
|
|
|
environment:
|
2019-09-30 15:54:55 +00:00
|
|
|
# Run garbage collection more aggressively to avoid getting OOMed during the lint phase.
|
2019-05-03 13:11:28 +00:00
|
|
|
GOGC: "20"
|
2019-07-15 09:20:08 +00:00
|
|
|
# By default Go uses GOMAXPROCS but a Circle CI executor has many
|
|
|
|
# cores (> 30) while the CPU and RAM resources are throttled. If we
|
|
|
|
# don't limit this to the number of allocated cores, the job is
|
|
|
|
# likely to get OOMed and killed.
|
|
|
|
GOOPTS: "-p 2"
|
2020-01-19 21:56:13 +00:00
|
|
|
GOMAXPROCS: "2"
|
2021-02-25 21:25:25 +00:00
|
|
|
GO111MODULE: "on"
|
2020-02-17 21:13:33 +00:00
|
|
|
- prometheus/check_proto:
|
2020-07-27 09:08:38 +00:00
|
|
|
version: "3.12.3"
|
2019-07-15 07:41:28 +00:00
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: prometheus
|
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: promtool
|
2019-10-24 08:43:22 +00:00
|
|
|
- go/save-cache:
|
|
|
|
key: v1
|
|
|
|
- save_cache:
|
2020-08-04 21:31:59 +00:00
|
|
|
key: v3-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
|
2019-10-24 08:43:22 +00:00
|
|
|
paths:
|
2020-08-04 21:31:59 +00:00
|
|
|
- /home/circleci/.cache/yarn
|
2020-02-24 10:50:05 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
2020-08-25 13:59:41 +00:00
|
|
|
|
2020-01-04 14:55:02 +00:00
|
|
|
test_windows:
|
2021-02-08 00:44:58 +00:00
|
|
|
executor:
|
|
|
|
name: win/default
|
|
|
|
shell: powershell
|
2020-01-04 14:55:02 +00:00
|
|
|
working_directory: /go/src/github.com/prometheus/prometheus
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-06-01 06:45:30 +00:00
|
|
|
- run:
|
|
|
|
# Temporary workaround until circleci updates go.
|
|
|
|
command: |
|
2021-02-25 21:25:25 +00:00
|
|
|
choco upgrade -y golang
|
2020-01-20 13:17:11 +00:00
|
|
|
- run:
|
2021-02-08 00:44:58 +00:00
|
|
|
command:
|
|
|
|
refreshenv
|
|
|
|
- run:
|
2020-01-20 13:17:11 +00:00
|
|
|
command: |
|
2020-10-08 07:38:28 +00:00
|
|
|
$env:GOARCH=""; $env:GOOS=""; cd web/ui; go generate
|
2021-02-08 00:44:58 +00:00
|
|
|
cd ../..
|
|
|
|
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
2020-10-08 07:38:28 +00:00
|
|
|
go test $TestTargets -vet=off -v
|
2020-01-20 13:17:11 +00:00
|
|
|
environment:
|
|
|
|
GOGC: "20"
|
2020-10-08 07:38:28 +00:00
|
|
|
GOOPTS: "-p 2"
|
2020-08-25 13:59:41 +00:00
|
|
|
|
2021-02-25 21:25:25 +00:00
|
|
|
test_tsdb_go115:
|
|
|
|
executor: golang_115
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: go test ./tsdb/...
|
|
|
|
|
2020-08-25 13:59:41 +00:00
|
|
|
test_mixins:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-10-08 07:38:28 +00:00
|
|
|
- run: go install ./cmd/promtool/.
|
2020-08-25 13:59:41 +00:00
|
|
|
- run:
|
|
|
|
command: go install -mod=readonly github.com/google/go-jsonnet/cmd/jsonnet github.com/google/go-jsonnet/cmd/jsonnetfmt github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
|
|
|
|
working_directory: ~/project/documentation/prometheus-mixin
|
|
|
|
- run:
|
|
|
|
command: make clean
|
|
|
|
working_directory: ~/project/documentation/prometheus-mixin
|
|
|
|
- run:
|
|
|
|
command: jb install
|
|
|
|
working_directory: ~/project/documentation/prometheus-mixin
|
|
|
|
- run:
|
|
|
|
command: make
|
|
|
|
working_directory: ~/project/documentation/prometheus-mixin
|
|
|
|
- run:
|
|
|
|
command: git diff --exit-code
|
|
|
|
working_directory: ~/project/documentation/prometheus-mixin
|
|
|
|
|
2020-06-17 14:51:32 +00:00
|
|
|
repo_sync:
|
2019-04-11 12:31:04 +00:00
|
|
|
executor: golang
|
|
|
|
steps:
|
|
|
|
- checkout
|
2021-03-29 10:57:59 +00:00
|
|
|
- run: mkdir -v -p "${PATH%%:*}" && curl -sL --fail https://github.com/mikefarah/yq/releases/download/v4.6.3/yq_linux_amd64 -o "${PATH%%:*}/yq" && chmod -v +x "${PATH%%:*}/yq"
|
2021-03-30 07:16:15 +00:00
|
|
|
- run: sha256sum -c <(echo "c4343783c3361495c0d6d1eb742bba7432aa65e13e9fb8d7e201d544bcf14246 ${PATH%%:*}/yq")
|
2020-06-17 14:51:32 +00:00
|
|
|
- run: ./scripts/sync_repo_files.sh
|
2019-04-11 12:31:04 +00:00
|
|
|
|
2018-04-21 05:35:53 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
prometheus:
|
|
|
|
jobs:
|
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-02-25 21:25:25 +00:00
|
|
|
- test_tsdb_go115:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-08-25 13:59:41 +00:00
|
|
|
- test_mixins:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-01-04 14:55:02 +00:00
|
|
|
- test_windows:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2021-03-17 19:14:54 +00:00
|
|
|
- prometheus/build:
|
2021-03-20 17:10:04 +00:00
|
|
|
name: build
|
|
|
|
parallelism: 12
|
2021-03-17 19:14:54 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
2021-02-22 19:19:08 +00:00
|
|
|
- prometheus/publish_main:
|
2019-05-29 08:02:30 +00:00
|
|
|
context: org-context
|
2018-04-21 05:35:53 +00:00
|
|
|
requires:
|
|
|
|
- test
|
2021-03-20 17:10:04 +00:00
|
|
|
- build
|
2018-04-21 05:35:53 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
2021-02-22 19:19:08 +00:00
|
|
|
only: main
|
2019-10-18 14:08:26 +00:00
|
|
|
image: circleci/golang:1-node
|
2019-07-15 07:41:28 +00:00
|
|
|
- prometheus/publish_release:
|
2019-05-29 08:02:30 +00:00
|
|
|
context: org-context
|
2018-04-21 05:35:53 +00:00
|
|
|
requires:
|
|
|
|
- test
|
2021-03-20 17:10:04 +00:00
|
|
|
- build
|
2018-04-21 05:35:53 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2019-10-18 14:08:26 +00:00
|
|
|
image: circleci/golang:1-node
|
2019-04-11 12:31:04 +00:00
|
|
|
nightly:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 0 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-02-22 19:19:08 +00:00
|
|
|
- main
|
2019-04-11 12:31:04 +00:00
|
|
|
jobs:
|
2020-06-17 14:51:32 +00:00
|
|
|
- repo_sync:
|
2019-05-29 08:02:30 +00:00
|
|
|
context: org-context
|