2018-03-08 12:43:49 +01:00
|
|
|
---
|
2018-11-29 12:06:34 +01:00
|
|
|
version: 2.1
|
2018-03-08 12:43:49 +01:00
|
|
|
|
2019-07-02 18:40:25 +02:00
|
|
|
orbs:
|
2020-05-03 21:48:28 +02:00
|
|
|
prometheus: prometheus/prometheus@0.4.0
|
2019-07-02 18:40:25 +02:00
|
|
|
|
2018-11-30 14:01:20 +01:00
|
|
|
executors:
|
2020-05-03 21:48:28 +02:00
|
|
|
# Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml
|
|
|
|
# should also be updated.
|
2018-11-30 14:01:20 +01:00
|
|
|
golang:
|
2018-03-08 12:43:49 +01:00
|
|
|
docker:
|
2020-09-23 21:06:58 +02:00
|
|
|
- image: circleci/golang:1.15
|
2018-11-30 14:01:20 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
executor: golang
|
2018-03-08 12:43:49 +01:00
|
|
|
|
|
|
|
steps:
|
2019-07-02 18:40:25 +02:00
|
|
|
- prometheus/setup_environment
|
2020-07-11 13:49:53 +02:00
|
|
|
- run: go mod download
|
2018-03-08 12:43:49 +01:00
|
|
|
- run: make
|
2019-07-02 18:40:25 +02:00
|
|
|
- prometheus/store_artifact:
|
|
|
|
file: node_exporter
|
2018-03-08 12:43:49 +01:00
|
|
|
|
2018-04-09 20:27:26 +02:00
|
|
|
codespell:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: sudo pip install codespell
|
2020-05-23 21:46:54 +02:00
|
|
|
- run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -L uint,packages\',uptodate
|
2018-04-09 20:27:26 +02:00
|
|
|
|
2020-08-25 09:59:39 +02:00
|
|
|
test_mixins:
|
|
|
|
executor: golang
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- 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 github.com/prometheus/prometheus/cmd/promtool
|
|
|
|
working_directory: ~/project/docs/node-mixin
|
|
|
|
- run:
|
|
|
|
command: make clean
|
|
|
|
working_directory: ~/project/docs/node-mixin
|
|
|
|
- run:
|
|
|
|
command: jb install
|
|
|
|
working_directory: ~/project/docs/node-mixin
|
|
|
|
- run:
|
|
|
|
command: make
|
|
|
|
working_directory: ~/project/docs/node-mixin
|
|
|
|
- run:
|
|
|
|
command: git diff --exit-code
|
|
|
|
working_directory: ~/project/docs/node-mixin
|
|
|
|
|
2018-03-08 12:43:49 +01:00
|
|
|
build:
|
2019-04-15 17:36:25 +02:00
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
2018-03-08 12:43:49 +01:00
|
|
|
|
|
|
|
environment:
|
2020-05-03 21:48:28 +02:00
|
|
|
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.14-base
|
2018-03-08 12:43:49 +01:00
|
|
|
REPO_PATH: github.com/prometheus/node_exporter
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
2020-01-27 10:55:35 +01:00
|
|
|
- run: docker run --privileged linuxkit/binfmt:v0.7
|
2018-03-08 12:43:49 +01:00
|
|
|
- run: make promu
|
2018-11-30 14:01:20 +01:00
|
|
|
- run: promu crossbuild
|
|
|
|
- run: promu --config .promu-cgo.yml crossbuild
|
2018-03-08 12:43:49 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- .build
|
2018-11-30 14:01:20 +01:00
|
|
|
- store_artifacts:
|
|
|
|
path: .build
|
|
|
|
destination: /build
|
2018-03-08 12:43:49 +01:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
if [ -n "$CIRCLE_TAG" ]; then
|
2018-07-23 09:38:39 +02:00
|
|
|
make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
|
2018-03-08 12:43:49 +01:00
|
|
|
else
|
2018-07-23 09:38:39 +02:00
|
|
|
make docker
|
2018-03-08 12:43:49 +01:00
|
|
|
fi
|
|
|
|
- run: docker images
|
|
|
|
- run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
if [ -n "$CIRCLE_TAG" ]; then
|
|
|
|
make test-docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
|
|
|
|
else
|
|
|
|
make test-docker
|
|
|
|
fi
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
node_exporter:
|
|
|
|
jobs:
|
2018-03-09 14:34:24 +01:00
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2018-04-09 20:27:26 +02:00
|
|
|
- codespell:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2020-08-25 09:59:39 +02:00
|
|
|
- test_mixins:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2019-07-02 18:40:25 +02:00
|
|
|
- prometheus/publish_master:
|
2019-06-03 11:17:59 +02:00
|
|
|
context: org-context
|
2018-03-08 12:43:49 +01:00
|
|
|
requires:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
2019-07-02 18:40:25 +02:00
|
|
|
- prometheus/publish_release:
|
2019-06-03 11:17:59 +02:00
|
|
|
context: org-context
|
2018-03-08 12:43:49 +01:00
|
|
|
requires:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
filters:
|
2018-03-09 14:18:13 +01:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-03-08 12:43:49 +01:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|