forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial deb and rpm packaging (open-telemetry#1278)
* Initial deb and rpm packaging - Uses https://github.com/jordansissel/fpm - Builds simple deb and rpm packages that installs the otelcol binary to `/usr/bin/otelcol` and `examples/otel-local-config.yaml` to `/etc/otel-collector/config.yaml`. - TODO: create systemd service scripts * Packaging updates - Add support for arm64 packages - Move files to internal/buildscripts/packaging/ - Use single Dockerfile for local deb and rpm builds - Explicitly set output dir for packages in circleci
- Loading branch information
Showing
7 changed files
with
152 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM debian:9 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y ruby ruby-dev rubygems build-essential git rpm | ||
|
||
RUN gem install --no-document fpm -v 1.11.0 | ||
|
||
VOLUME /repo | ||
WORKDIR /repo | ||
|
||
ENV PACKAGE="deb" | ||
ENV VERSION="" | ||
ENV ARCH="amd64" | ||
ENV OUTPUT_DIR="/repo/bin/" | ||
|
||
CMD ./internal/buildscripts/packaging/fpm/$PACKAGE/build.sh "$VERSION" "$ARCH" "$OUTPUT_DIR" |
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,10 @@ | ||
# Build otel-collector deb package | ||
|
||
Build the otel-collector deb package with [fpm](https://github.com/jordansissel/fpm). | ||
|
||
To build the deb package, run `make deb-package` from the repo root directory. The deb package will be written to | ||
`bin/otel-collector_<version>_<arch>.deb`. | ||
|
||
By default, `<arch>` is `amd64` and `<version>` is the latest git tag with `-post` appended, e.g. `1.2.3-post`. | ||
To override these defaults, set the `ARCH` and `VERSION` environment variables, e.g. | ||
`ARCH=arm64 VERSION=4.5.6 make deb-package`. |
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,28 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )" | ||
REPO_DIR="$( cd "$SCRIPT_DIR/../../../../../" && pwd )" | ||
VERSION="${1:-}" | ||
ARCH="${2:-"amd64"}" | ||
OUTPUT_DIR="${3:-"$REPO_DIR/bin/"}" | ||
OTELCOL_PATH="$REPO_DIR/bin/otelcol_linux_amd64" | ||
CONFIG_PATH="$REPO_DIR/examples/otel-local-config.yaml" | ||
|
||
if [[ -z "$VERSION" ]]; then | ||
latest_tag="$( git describe --abbrev=0 --match v[0-9]* )" | ||
VERSION="${latest_tag}-post" | ||
fi | ||
|
||
fpm -s dir -t deb -n otel-collector -v ${VERSION#v} -f -p "$OUTPUT_DIR" \ | ||
--vendor "OpenTelemetry Community" \ | ||
--maintainer "OpenTelemetry Community <[email protected]>" \ | ||
--description "OpenTelemetry Collector" \ | ||
--license "Apache 2.0" \ | ||
--url "https://github.com/open-telemetry/opentelemetry-collector" \ | ||
--architecture "$ARCH" \ | ||
--config-files /etc/otel-collector/config.yaml \ | ||
--deb-dist "stable" \ | ||
$OTELCOL_PATH=/usr/bin/otelcol \ | ||
$CONFIG_PATH=/etc/otel-collector/config.yaml |
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,10 @@ | ||
# Build otel-collector rpm package | ||
|
||
Build the otel-collector rpm package with [fpm](https://github.com/jordansissel/fpm). | ||
|
||
To build the rpm package, run `make rpm-package` from the repo root directory. The rpm package will be written to | ||
`bin/otel-collector-<version>.<arch>.rpm`. | ||
|
||
By default, `<arch>` is `amd64` and `<version>` is the latest git tag with `~post` appended, e.g. `1.2.3~post`. | ||
To override these defaults, set the `ARCH` and `VERSION` environment variables, e.g. | ||
`ARCH=arm64 VERSION=4.5.6 make rpm-package`. |
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,28 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname ${BASH_SOURCE[0]} )" && pwd )" | ||
REPO_DIR="$( cd "$SCRIPT_DIR/../../../../../" && pwd )" | ||
VERSION="${1:-}" | ||
ARCH="${2:-"amd64"}" | ||
OUTPUT_DIR="${3:-"$REPO_DIR/bin/"}" | ||
OTELCOL_PATH="$REPO_DIR/bin/otelcol_linux_amd64" | ||
CONFIG_PATH="$REPO_DIR/examples/otel-local-config.yaml" | ||
|
||
if [[ -z "$VERSION" ]]; then | ||
latest_tag="$( git describe --abbrev=0 --match v[0-9]* )" | ||
VERSION="${latest_tag}~post" | ||
fi | ||
|
||
fpm -s dir -t rpm -n otel-collector -v ${VERSION#v} -f -p "$OUTPUT_DIR" \ | ||
--vendor "OpenTelemetry Community" \ | ||
--maintainer "OpenTelemetry Community <[email protected]>" \ | ||
--description "OpenTelemetry Collector" \ | ||
--license "Apache 2.0" \ | ||
--rpm-summary "OpenTelemetry Collector" \ | ||
--url "https://github.com/open-telemetry/opentelemetry-collector" \ | ||
--architecture "$ARCH" \ | ||
--config-files /etc/otel-collector/config.yaml \ | ||
$OTELCOL_PATH=/usr/bin/otelcol \ | ||
$CONFIG_PATH=/etc/otel-collector/config.yaml |