Skip to content

Commit

Permalink
Package logcli as rpm and deb. (#4667)
Browse files Browse the repository at this point in the history
* Package logcli as rpm, deb and apk.

* Package logcli on release builds.
  • Loading branch information
jeschkies authored Jan 18, 2022
1 parent dddace8 commit b03e278
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ dist: clean
for i in dist/*; do zip -j -m $$i.zip $$i; done
pushd dist && sha256sum * > SHA256SUMS && popd

publish: dist
packages: dist
nfpm package -f tools/nfpm.yaml -p rpm -t dist/
nfpm package -f tools/nfpm.yaml -p deb -t dist/

publish: packages
./tools/release

########
Expand Down
5 changes: 5 additions & 0 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ RUN GO111MODULE=on go get github.com/fatih/faillint@v1.5.0
FROM golang:1.17.2 as ghr
RUN GO111MODULE=on go get github.com/tcnksm/ghr

# Install nfpm (https://nfpm.goreleaser.com) for creating .deb and .rpm packages.
FROM golang:1.17.2 as nfpm
RUN GO111MODULE=on go get github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3

FROM golang:1.17.2-buster
RUN apt-get update && \
apt-get install -qy \
Expand All @@ -59,6 +63,7 @@ COPY --from=golangci /bin/golangci-lint /usr/local/bin
COPY --from=drone /usr/local/bin/drone /usr/bin/drone
COPY --from=faillint /go/bin/faillint /usr/bin/faillint
COPY --from=ghr /go/bin/ghr /usr/bin/ghr
COPY --from=nfpm /go/bin/nfpm /usr/bin/nfpm

# Install some necessary dependencies.
# Forcing GO111MODULE=on is required to specify dependencies at specific versions using the go mod notation.
Expand Down
17 changes: 17 additions & 0 deletions tools/nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "logcli"
arch: "amd64"
platform: "linux"
version: ${CIRCLE_TAG}
section: "default"
provides:
- logcli
maintainer: "Grafana Labs <support@grafana.com>"
description: |
LogCLI is the command-line interface to Loki.
It facilitates running LogQL queries against a Loki instance.
vendor: "Grafana Labs Inc"
homepage: "https://grafana.com/loki"
license: "AGPL-3.0"
contents:
- src: ./dist/logcli-linux-amd64
dst: /usr/local/bin/logcli

0 comments on commit b03e278

Please sign in to comment.