Skip to content
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

Add Elasticsearch helper binaries to release #5501

Merged
merged 6 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test-and-lint: test fmt lint

.PHONY: echo-version
echo-version:
@echo "GIT_CLOSEST_TAG=$(GIT_CLOSEST_TAG)"
@echo "$(GIT_CLOSEST_TAG)"

.PHONY: echo-all-pkgs
echo-all-pkgs:
Expand Down
32 changes: 30 additions & 2 deletions scripts/package-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ function stage-platform-files {
cp "./cmd/ingester/ingester-${PLATFORM}" "${PACKAGE_STAGING_DIR}/jaeger-ingester${FILE_EXTENSION}"
cp "./examples/hotrod/hotrod-${PLATFORM}" "${PACKAGE_STAGING_DIR}/example-hotrod${FILE_EXTENSION}"
}
# stage-tool-platform-files stages the different tool files in the platform ($1) into the package
# staging dir ($2). If you pass in a file extension ($3) it will be used when
# copying on the source
function stage-tool-platform-files {
local -r PLATFORM=$1
local -r TOOLS_PACKAGE_STAGING_DIR=$2
local -r FILE_EXTENSION=${3:-}

cp "./cmd/es-index-cleaner/es-index-cleaner-${PLATFORM}" "${TOOLS_PACKAGE_STAGING_DIR}/jaeger-es-index-cleaner${FILE_EXTENSION}"
cp "./cmd/es-rollover/es-rollover-${PLATFORM}" "${TOOLS_PACKAGE_STAGING_DIR}/jaeger-es-rollover${FILE_EXTENSION}"
cp "./cmd/esmapping-generator/esmapping-generator-${PLATFORM}" "${TOOLS_PACKAGE_STAGING_DIR}/jaeger-esmapping-generator${FILE_EXTENSION}"
}

# package pulls built files for the platform ($2) and compresses it using the compression ($1).
# If you pass in a file extension ($3) it will be look for binaries with that extension.
Expand All @@ -25,28 +37,44 @@ function package {
local -r FILE_EXTENSION=${3:-}
local -r PACKAGE_NAME=jaeger-$VERSION-$PLATFORM
local -r PACKAGE_STAGING_DIR=$PACKAGE_NAME
local -r TOOLS_PACKAGE_NAME=jaeger-tools-$VERSION-$PLATFORM
local -r TOOLS_PACKAGE_STAGING_DIR=$TOOLS_PACKAGE_NAME

if [ -d "$PACKAGE_STAGING_DIR" ]
then
rm -vrf "$PACKAGE_STAGING_DIR"
fi
if [ -d "$TOOLS_PACKAGE_STAGING_DIR" ]
then
rm -vrf "$TOOLS_PACKAGE_STAGING_DIR"
fi
mkdir "$PACKAGE_STAGING_DIR"
mkdir "$TOOLS_PACKAGE_STAGING_DIR"
stage-platform-files "$PLATFORM" "$PACKAGE_STAGING_DIR" "$FILE_EXTENSION"
stage-tool-platform-files "$PLATFORM" "$TOOLS_PACKAGE_STAGING_DIR" "$FILE_EXTENSION"
# Create a checksum file for all the files being packaged in the archive. Sorted by filename.
find "$PACKAGE_STAGING_DIR" -type f -exec shasum -b -a 256 {} \; | sort -k2 | tee "./deploy/$PACKAGE_NAME.sha256sum.txt"
find "$TOOLS_PACKAGE_STAGING_DIR" -type f -exec shasum -b -a 256 {} \; | sort -k2 | tee "./deploy/$TOOLS_PACKAGE_NAME.sha256sum.txt"

if [ "$COMPRESSION" == "zip" ]
then
local -r ARCHIVE_NAME="$PACKAGE_NAME.zip"
echo "Packaging into $ARCHIVE_NAME:"
zip -r "./deploy/$ARCHIVE_NAME" "$PACKAGE_STAGING_DIR"
local -r TOOLS_ARCHIVE_NAME="$TOOLS_PACKAGE_NAME.zip"
echo "Packaging into $TOOLS_ARCHIVE_NAME:"
zip -r "./deploy/$TOOLS_ARCHIVE_NAME" "$TOOLS_PACKAGE_STAGING_DIR"
else
local -r ARCHIVE_NAME="$PACKAGE_NAME.tar.gz"
echo "Packaging into $ARCHIVE_NAME:"
tar --sort=name -czvf "./deploy/$ARCHIVE_NAME" "$PACKAGE_STAGING_DIR"
local -r TOOLS_ARCHIVE_NAME="$TOOLS_PACKAGE_NAME.tar.gz"
echo "Packaging into $TOOLS_ARCHIVE_NAME:"
tar --sort=name -czvf "./deploy/$TOOLS_ARCHIVE_NAME" "$TOOLS_PACKAGE_STAGING_DIR"
fi

rm -rf "$PACKAGE_STAGING_DIR"
rm -rf "$PACKAGE_STAGING_DIR"
rm -rf "$TOOLS_PACKAGE_STAGING_DIR"
}

set -e
Expand Down Expand Up @@ -79,4 +107,4 @@ find deploy \( ! -name '*sha256sum.txt' \) -type f -exec shasum -b -a 256 {} \;
find deploy \( ! -name '*sha256sum.txt' \) -type f -exec gpg --armor --detach-sign {} \;

# show your work
ls -lF deploy/
ls -lF deploy/
Loading