-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from go-graphite/nfpm
Migrate to nfpm, get rid of gox
- Loading branch information
Showing
5 changed files
with
70 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: ${NAME} | ||
description: ${DESCRIPTION} | ||
|
||
# Common packages config | ||
arch: "${ARCH}" # amd64, arm64 | ||
platform: "linux" | ||
version: "${VERSION_STRING}" | ||
maintainer: &m "Roman Lomonosov <r.lomonosov@gmail.com>" | ||
vendor: *m | ||
homepage: "https://github.com/go-graphite/${NAME}" | ||
license: "MIT" | ||
section: "admin" | ||
priority: "optional" | ||
|
||
contents: | ||
- src: deploy/root/usr/ | ||
dst: /usr | ||
expand: true | ||
- src: deploy/root/etc/logrotate.d/${NAME} | ||
dst: /etc/logrotate.d/${NAME} | ||
type: config|noreplace | ||
expand: true | ||
- src: out/root/etc/${NAME}/${NAME}.conf | ||
dst: /etc/${NAME}/${NAME}.conf | ||
type: config|noreplace | ||
expand: true | ||
- src: "out/${NAME}-linux-${ARCH}" | ||
dst: /usr/bin/${NAME} | ||
expand: true | ||
# docs | ||
- src: LICENSE | ||
dst: /usr/share/doc/${NAME}/LICENSE | ||
expand: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
#!/bin/sh | ||
#!/bin/sh -e | ||
|
||
cd `dirname $0` | ||
cd "$( dirname "$0" )" | ||
ROOT=$PWD | ||
|
||
docker run -ti --rm -v $ROOT:/root/go/src/github.com/lomik/graphite-clickhouse ubuntu:20.04 bash -c ' | ||
docker run -i -e "DEVEL=${DEVEL:-0}" --rm -v "$ROOT:/root/go/src/github.com/lomik/graphite-clickhouse" golang bash -e << 'EOF' | ||
cd /root/ | ||
export GO_VERSION=1.15.1 | ||
export TZ=Europe/Moscow | ||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
apt update | ||
DEBIAN_FRONTEND=noninteractive apt install -y rpm ruby ruby-dev wget make git gcc | ||
wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | ||
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz | ||
ln -s /usr/local/go/bin/go /usr/local/bin/go | ||
# newer fpm is broken https://github.com/jordansissel/fpm/issues/1612 | ||
gem install rake | ||
gem install fpm:1.10.2 | ||
go get github.com/mitchellh/gox | ||
ln -s /root/go/bin/gox /usr/local/bin/gox | ||
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.40.0 | ||
cd /root/go/src/github.com/lomik/graphite-clickhouse | ||
make gox-build | ||
make fpm-deb | ||
make fpm-rpm | ||
' | ||
# go reads the VCS state | ||
git config --global --add safe.directory "$PWD" | ||
make nfpm-deb nfpm-rpm | ||
chmod -R a+w *.deb *.rpm out/ | ||
EOF |