Merge pull request #1823 from simonpasquier/add-mixin-to-ci

*: add mixin tests to CI
This commit is contained in:
Ben Kochie 2020-08-25 12:00:55 +02:00 committed by GitHub
commit e51b508428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1216 additions and 33 deletions

View file

@ -31,6 +31,26 @@ jobs:
- run: sudo pip install codespell
- run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -L uint,packages\',uptodate
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
build:
machine:
image: ubuntu-1604:201903-01
@ -85,6 +105,10 @@ workflows:
filters:
tags:
only: /.*/
- test_mixins:
filters:
tags:
only: /.*/
- prometheus/publish_master:
context: org-context
requires:

View file

@ -259,7 +259,7 @@
},
annotations: {
summary: 'RAID Array is degraded',
description: 'RAID array '{{ $labels.device }}' on {{ $labels.instance }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.',
description: "RAID array '{{ $labels.device }}' on {{ $labels.instance }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.",
},
},
{
@ -272,7 +272,7 @@
},
annotations: {
summary: 'Failed device in RAID array',
description: 'At least one device in RAID array on {{ $labels.instance }} failed. Array '{{ $labels.device }}' needs attention and possibly a disk swap.',
description: "At least one device in RAID array on {{ $labels.instance }} failed. Array '{{ $labels.device }}' needs attention and possibly a disk swap.",
},
},
],

9
docs/node-mixin/go.mod Normal file
View file

@ -0,0 +1,9 @@
module github.com/prometheus/node_exporter/docs/node-mixin
go 1.15
require (
github.com/google/go-jsonnet v0.16.0
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0
github.com/prometheus/prometheus v1.8.2-0.20200805170718-983ebb4a5133
)

1125
docs/node-mixin/go.sum Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,34 +1,33 @@
{
"dependencies": [
{
"name": "grafonnet",
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet-lib",
"subdir": "grafonnet"
}
},
"version": "master"
},
{
"name": "grafana-builder",
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs",
"subdir": "grafana-builder"
}
},
"version": "master"
},
{
"name": "promgrafonnet",
"source": {
"git": {
"remote": "https://github.com/kubernetes-monitoring/kubernetes-mixin",
"subdir": "lib/promgrafonnet"
}
},
"version": "master"
"version": 1,
"dependencies": [
{
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet-lib.git",
"subdir": "grafonnet"
}
]
},
"version": "master"
},
{
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "grafana-builder"
}
},
"version": "master"
},
{
"source": {
"git": {
"remote": "https://github.com/kubernetes-monitoring/kubernetes-mixin.git",
"subdir": "lib/promgrafonnet"
}
},
"version": "master"
}
],
"legacyImports": true
}

26
docs/node-mixin/tools.go Normal file
View file

@ -0,0 +1,26 @@
// Copyright 2020 The prometheus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//+build tools
// Package tools tracks dependencies for tools that used in the build process.
// See https://github.com/golang/go/issues/25922
package tools
import (
_ "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"
)