39 строки
953 B
Bash
Executable File
39 строки
953 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
# set -x
|
|
|
|
BUILD_DIR=$1
|
|
CACHE_DIR=$2
|
|
ENV_DIR=$3
|
|
|
|
BUILDPACK_DIR=$(cd "$(dirname "$0")"; cd ..; pwd)
|
|
LS_DIR="$BUILD_DIR/.lightstep-collector"
|
|
PROFILE_DIR="$BUILD_DIR/.profile.d"
|
|
|
|
VERSION="2021.11.29.19.40.05Z"
|
|
CACHED_VERSION="$CACHE_DIR/lightstep-collector-$VERSION"
|
|
|
|
arrow() {
|
|
echo '----->' "$@"
|
|
}
|
|
|
|
if [ ! -d "$CACHED_VERSION" ]; then
|
|
arrow "Installing LightStep collector ${VERSION}"
|
|
wget \
|
|
-O lightstep-collector.deb \
|
|
--quiet \
|
|
--content-disposition \
|
|
https://packagecloud.io/lightstep/microsatellite/packages/ubuntu/bionic/lightstep-collector_${VERSION}_amd64.deb/download.deb
|
|
|
|
dpkg -x lightstep-collector.deb "$CACHED_VERSION"
|
|
else
|
|
arrow "LightStep collector ${VERSION} found in cache"
|
|
fi
|
|
|
|
mkdir -p "$LS_DIR"
|
|
cp "$CACHED_VERSION/opt/lightstep/collector" "$LS_DIR/collector"
|
|
|
|
mkdir -p "$PROFILE_DIR"
|
|
cp "$BUILDPACK_DIR/extra/lightstep-collector.sh" "$PROFILE_DIR/lightstep-collector.sh"
|