Skip to content

Commit

Permalink
Add Elasticsearch helper binaries to release (jaegertracing#5501)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Resolves jaegertracing#5499 
## Description of the changes
- Add the es helpers to scripts/package-deploy.sh

## How was this change tested?
- 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <[email protected]>
  • Loading branch information
FlamingSaint authored Jun 1, 2024
1 parent ba4da0d commit ca50f53
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
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/

0 comments on commit ca50f53

Please sign in to comment.