Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deb and rpm packaging for all binaries
Browse files Browse the repository at this point in the history
This is currently enabled for logcli amd64. This PR also packages `logcli`, `loki-canary` and `loki`
It also creates those packages for amd64, arm64 and arm
This will add a lot of files to releases, but the goal is to, soon, send those to actual yum and apt repositories
julienduchesne committed Jun 22, 2022
1 parent 167c95c commit bdea709
Showing 4 changed files with 57 additions and 23 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -258,11 +258,7 @@ dist: clean
pushd dist && sha256sum * > SHA256SUMS && popd

packages: dist
mkdir -p dist/tmp
unzip dist/logcli-linux-amd64.zip -d dist/tmp
nfpm package -f tools/nfpm.yaml -p rpm -t dist/
nfpm package -f tools/nfpm.yaml -p deb -t dist/
rm -rf dist/tmp
@tools/package-nfpm.sh

publish: packages
./tools/release
18 changes: 0 additions & 18 deletions tools/nfpm.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions tools/package-nfpm.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local descriptions = {
logcli: |||
LogCLI is the command-line interface to Loki.
It facilitates running LogQL queries against a Loki instance.
|||,

'loki-canary': 'Loki Canary is a standalone app that audits the log-capturing performance of a Grafana Loki cluster.',

loki: |||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus.
It is designed to be very cost effective and easy to operate.
It does not index the contents of the logs, but rather a set of labels for each log stream.
|||,

promtail: |||
Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud.
It is usually deployed to every machine that has applications needed to be monitored.
|||,
};

local name = std.extVar('name');
local arch = std.extVar('arch');

{
name: name,
arch: arch,
platform: 'linux',
version: '${CIRCLE_TAG}',
section: 'default',
provides: [name],
maintainer: 'Grafana Labs <support@grafana.com>',
description: descriptions[name],
vendor: 'Grafana Labs Inc',
homepage: 'https://grafana.com/loki',
changelog: 'https://github.com/grafana/loki/blob/main/CHANGELOG.md',
license: 'AGPL-3.0',
contents: [{
src: './dist/tmp/packages/%s-linux-%s' % [name, arch],
dst: '/usr/local/bin/%s' % name,
}],
}
15 changes: 15 additions & 0 deletions tools/package-nfpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

rm -rf dist/tmp && mkdir -p dist/tmp/packages
unzip dist/\*.zip -d dist/tmp/packages

for name in loki loki-canary logcli promtail; do
for arch in amd64 arm64 arm; do
config_path="dist/tmp/config-${name}-${arch}.json"
jsonnet -V "name=${name}" -V "arch=${arch}" "tools/package-nfpm.jsonnet" > "${config_path}"
nfpm package -f "${config_path}" -p rpm -t dist/
nfpm package -f "${config_path}" -p deb -t dist/
done
done

rm -rf dist/tmp

0 comments on commit bdea709

Please sign in to comment.