Skip to content

Commit 1f833f9

Browse files
Prometheus exporter ci (#84)
* Add CI for prometheus-exporter
1 parent eb956e2 commit 1f833f9

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go:
77
script:
88
- echo "Nginx Prometheus Exporter - commit:${TRAVIS_COMMIT}"
99
- make test
10-
- make container
10+
- make container DOCKER_BUILDKIT=0;
1111
before_install:
1212
- echo "PR Slug:${TRAVIS_PULL_REQUEST_SLUG}"
1313
- if [[ "${TRAVIS_PULL_REQUEST_SLUG}" == "nginxinc/nginx-prometheus-exporter" || "${TRAVIS_PULL_REQUEST}" == "false" ]]; then

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
VERSION = 0.5.0
2-
PREFIX = nginx/nginx-prometheus-exporter
32
TAG = $(VERSION)
3+
PREFIX = nginx/nginx-prometheus-exporter
4+
5+
DOCKERFILEPATH = build
6+
DOCKERFILE = Dockerfile
7+
48
GIT_COMMIT = $(shell git rev-parse --short HEAD)
59

610
BUILD_DIR = build_output
711

8-
nginx-prometheus-exporter: test
12+
export DOCKER_BUILDKIT = 1
13+
14+
nginx-prometheus-exporter:
915
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
1016

1117
lint:
@@ -15,7 +21,7 @@ test:
1521
GO111MODULE=on go test -mod=vendor ./...
1622

1723
container:
18-
docker build --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) -t $(PREFIX):$(TAG) .
24+
docker build --build-arg VERSION=$(VERSION) --build-arg GIT_COMMIT=$(GIT_COMMIT) -f $(DOCKERFILEPATH)/$(DOCKERFILE) -t $(PREFIX):$(TAG) .
1925

2026
push: container
2127
docker push $(PREFIX):$(TAG)
File renamed without changes.

build/ci/Jenkinsfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node {
2+
git(
3+
url: "${libsLocation}",
4+
credentialsId: "${githubCreds}"
5+
)
6+
load 'nginx-prometheus-exporter/Jenkinsfile'
7+
}

0 commit comments

Comments
 (0)