Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Build debian packages from precompiled binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Mar 20, 2020
1 parent 4d895ce commit d3e59ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
35 changes: 19 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
stages:
- validate
- build
- binaries
- packages
- upload
- announce

Expand All @@ -11,11 +12,13 @@ stages:
- master

.build_package:
stage: build
stage: packages
extends:
- .release
script:
- ci/build_package
needs:
- build:binaries
artifacts:
paths:
- .result/
Expand All @@ -39,7 +42,7 @@ validate:
- ci/validate_version

build:image:
stage: build
stage: packages
image: docker:latest
services:
- docker:19.03.5-dind
Expand All @@ -48,6 +51,19 @@ build:image:
script:
- ci/build_image

build:binaries:
stage: binaries
extends:
- .release
image: golang:1.13-alpine
script:
- apk add -U binutils
- ci/build_binaries
artifacts:
paths:
- binaries/
expire_in: 30m

build:stretch:
extends:
- .build_package
Expand Down Expand Up @@ -100,19 +116,6 @@ upload:bionic:
needs:
- build:bionic

build:binaries:
stage: build
extends:
- .release
image: golang:1.13-alpine
script:
- apk add -U binutils
- ci/build_binaries
artifacts:
paths:
- binaries/
expire_in: 30m

announce:
stage: announce
extends:
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: prometheus-logstash-exporter
Maintainer: Alexey Remizov <[email protected]>
Section: utils
Priority: optional
Build-Depends: debhelper (>= 9), dh-systemd, dh-golang, golang (>= 2:1.6)
Build-Depends: debhelper (>= 9), dh-systemd
Standards-Version: 3.9.4

Package: prometheus-logstash-exporter
Expand Down
10 changes: 3 additions & 7 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/usr/bin/make -f

export DH_GOPKG := gitlab.com/alxrem/prometheus-logstash-exporter
export DH_GOLANG_EXCLUDES := vendor

%:
dh $@ --buildsystem=golang --with=golang,systemd

override_dh_auto_test:
dh $@ --with=systemd

override_dh_auto_install:
dh_auto_install -- --no-source
mkdir -p debian/prometheus-logstash-exporter/usr/bin/
install -m 0755 binaries/prometheus-logstash-exporter-*-linux-amd64 debian/prometheus-logstash-exporter/usr/bin/prometheus-logstash-exporter

0 comments on commit d3e59ef

Please sign in to comment.