-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial deb and rpm packaging #1278
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should an
upgrade
happen here as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upgrade
upgrades other deps, update just refreshes the repositories.