25 lines
No EOL
929 B
Bash
Executable file
25 lines
No EOL
929 B
Bash
Executable file
#!/bin/bash
|
|
set -euxo pipefail
|
|
|
|
export VERSION=12.0.0
|
|
export PACKAGE_NAME=azure-batch
|
|
WORKING_DIR=$(pwd)
|
|
|
|
# Download the release and unpack it.
|
|
curl -LO https://github.com/Azure/azure-sdk-for-python/archive/refs/tags/${PACKAGE_NAME}_${VERSION}.tar.gz
|
|
tar xzf ${PACKAGE_NAME}_${VERSION}.tar.gz
|
|
|
|
# Find the package directory in the SDK release and the parent directory.
|
|
PACKAGE_DIR=$(find azure-sdk-for-python-${PACKAGE_NAME}_${VERSION} -type d -name $PACKAGE_NAME)
|
|
PARENT_DIR=$(dirname $PACKAGE_DIR)
|
|
|
|
# Build a tarball with a prefix directory that contains the package name and
|
|
# version. Store that in the directory where the script is running.
|
|
pushd $PARENT_DIR
|
|
tar --transform "s/^${PACKAGE_NAME}/${PACKAGE_NAME}-${VERSION}/" -cz \
|
|
-f ${WORKING_DIR}/${PACKAGE_NAME}-${VERSION}.tgz $PACKAGE_NAME
|
|
popd
|
|
|
|
# Clean up.
|
|
rm -f tar xzf ${PACKAGE_NAME}_${VERSION}.tar.gz
|
|
rm -rf azure-sdk-for-python-${PACKAGE_NAME}_${VERSION} |