1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-08-05 06:41:09 +03:00

Prometheus exporter ci (#84)

* Add CI for prometheus-exporter
This commit is contained in:
David Boenig
2020-02-18 11:54:32 +00:00
committed by GitHub
parent eb956e2ca6
commit 1f833f91ea
4 changed files with 17 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ go:
script: script:
- echo "Nginx Prometheus Exporter - commit:${TRAVIS_COMMIT}" - echo "Nginx Prometheus Exporter - commit:${TRAVIS_COMMIT}"
- make test - make test
- make container - make container DOCKER_BUILDKIT=0;
before_install: before_install:
- echo "PR Slug:${TRAVIS_PULL_REQUEST_SLUG}" - echo "PR Slug:${TRAVIS_PULL_REQUEST_SLUG}"
- if [[ "${TRAVIS_PULL_REQUEST_SLUG}" == "nginxinc/nginx-prometheus-exporter" || "${TRAVIS_PULL_REQUEST}" == "false" ]]; then - if [[ "${TRAVIS_PULL_REQUEST_SLUG}" == "nginxinc/nginx-prometheus-exporter" || "${TRAVIS_PULL_REQUEST}" == "false" ]]; then

View File

@@ -1,11 +1,17 @@
VERSION = 0.5.0 VERSION = 0.5.0
PREFIX = nginx/nginx-prometheus-exporter
TAG = $(VERSION) TAG = $(VERSION)
PREFIX = nginx/nginx-prometheus-exporter
DOCKERFILEPATH = build
DOCKERFILE = Dockerfile
GIT_COMMIT = $(shell git rev-parse --short HEAD) GIT_COMMIT = $(shell git rev-parse --short HEAD)
BUILD_DIR = build_output BUILD_DIR = build_output
nginx-prometheus-exporter: test export DOCKER_BUILDKIT = 1
nginx-prometheus-exporter:
GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -installsuffix cgo -ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)" -o nginx-prometheus-exporter GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -installsuffix cgo -ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)" -o nginx-prometheus-exporter
lint: lint:
@@ -15,7 +21,7 @@ test:
GO111MODULE=on go test -mod=vendor ./... GO111MODULE=on go test -mod=vendor ./...
container: container:
docker build --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) -t $(PREFIX):$(TAG) . docker build --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) -f $(DOCKERFILEPATH)/$(DOCKERFILE) -t $(PREFIX):$(TAG) .
push: container push: container
docker push $(PREFIX):$(TAG) docker push $(PREFIX):$(TAG)

7
build/ci/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,7 @@
node {
git(
url: "${libsLocation}",
credentialsId: "${githubCreds}"
)
load 'nginx-prometheus-exporter/Jenkinsfile'
}