Skip to content

Commit

Permalink
SDK - Improve the python package build (#364)
Browse files Browse the repository at this point in the history
* Make the script fail on error.
* Support relative output paths: `./build.sh kfp.tar.gz`
* Support default output path (`./kfp.tar.gz`): `./build.sh`
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Dec 3, 2018
1 parent e0a2cf6 commit d355a15
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sdk/python/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -ex
#
# Copyright 2018 Google LLC
#
Expand All @@ -25,6 +25,13 @@
# apt-get install --no-install-recommends -y -q default-jdk
# wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar -O /tmp/swagger-codegen-cli.jar

get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}

target_archive_file=${1:-kfp.tar.gz}
target_archive_file=$(get_abs_filename "$target_archive_file")

DIR=$(mktemp -d)

Expand All @@ -42,5 +49,5 @@ cp ./setup.py $DIR
# Build tarball package.
cd $DIR
python setup.py sdist --format=gztar
cp $DIR/dist/*.tar.gz $1
cp $DIR/dist/*.tar.gz "$target_archive_file"
rm -rf $DIR

0 comments on commit d355a15

Please sign in to comment.