Skip to content

Commit

Permalink
chore: add command line options to pyinstaller build script (#2829)
Browse files Browse the repository at this point in the history
* chore: add command line options to pyinstaller build script

* Update quotes

* fix the dist folder name

* update logs

* trigger appveyor build
  • Loading branch information
wchengru committed Apr 26, 2021
1 parent f7c12ef commit 0f3ed01
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions installer/pyinstaller/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
binary_zip_filename=$1
python_library_zip_filename=$2
python_version=$3
nightly_build=$4
build_binary_name=$4
build_folder=$5

if [ "$python_library_zip_filename" = "" ]; then
python_library_zip_filename="python-libraries.zip";
Expand All @@ -12,8 +13,8 @@ if [ "$python_version" = "" ]; then
python_version="3.7.9";
fi

if ! [ "$nightly_build" = "" ]; then
echo "Building native installer with nightly build"
if ! [ "$build_binary_name" = "" ]; then
echo "Building native installer with nightly/beta build"
is_nightly="true"
else
echo "Building native installer with normal build"
Expand Down Expand Up @@ -58,8 +59,8 @@ echo "Installing PyInstaller"
echo "Building Binary"
cd src
if [ "$is_nightly" = "true" ]; then
echo "Updating samcli.spec with nightly build"
sed -i.bak "s/'sam'/'sam-nightly'/g" installer/pyinstaller/samcli.spec
echo "Updating samcli.spec with nightly/beta build"
sed -i.bak "s/'sam'/'$build_binary_name'/g" installer/pyinstaller/samcli.spec
rm installer/pyinstaller/samcli.spec.bak
fi
echo "samcli.spec content is:"
Expand All @@ -70,17 +71,17 @@ cat installer/pyinstaller/samcli.spec
mkdir pyinstaller-output
dist_folder="sam"
if [ "$is_nightly" = "true" ]; then
echo "using dist_folder with nightly build"
dist_folder="sam-nightly"
echo "using dist_folder with nightly/beta build"
dist_folder=$build_binary_name
fi
echo "dist_folder=$dist_folder"
mv "dist/$dist_folder" pyinstaller-output/dist
cp installer/assets/* pyinstaller-output
chmod 755 pyinstaller-output/install
if [ "$is_nightly" = "true" ]; then
echo "Updating install script with nightly build"
sed -i.bak "s/\/usr\/local\/aws-sam-cli/\/usr\/local\/aws-sam-cli-nightly/g" pyinstaller-output/install
sed -i.bak 's/EXE_NAME=\"sam\"/EXE_NAME=\"sam-nightly\"/g' pyinstaller-output/install
echo "Updating install script with nightly/beta build"
sed -i.bak "s/\/usr\/local\/aws-sam-cli/\/usr\/local\/$build_folder/g" pyinstaller-output/install
sed -i.bak 's/EXE_NAME=\"sam\"/EXE_NAME=\"'$build_binary_name'\"/g' pyinstaller-output/install
rm pyinstaller-output/install.bak
fi
echo "install script content is:"
Expand Down

0 comments on commit 0f3ed01

Please sign in to comment.