Distro zip file from tar file #449 (#543)

* Create zip file from tar file

* Formatting
This commit is contained in:
Nabeel S
2020-02-10 10:40:42 -05:00
committed by GitHub
parent 989e86ecd3
commit 90e1b3317d
8 changed files with 303 additions and 150 deletions

View File

@@ -35,6 +35,7 @@ if [ "$TRAVIS" = "true" ]; then
FILE_NAME="phpvms-$PKG_NAME"
TAR_NAME="$FILE_NAME.tar.gz"
ZIP_NAME="$FILE_NAME.zip"
echo "Cleaning files"
@@ -109,6 +110,15 @@ if [ "$TRAVIS" = "true" ]; then
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
# Create zip https://stackoverflow.com/a/6301947
for f in *.tar.gz;\
do rm -rf ${f%.tar.gz} ;\
mkdir ${f%.tar.gz} ;\
tar -C ${f%.tar.gz} zxvf $f ;\
zip -r ${f%.tar.gz} $f.zip ;\
rm -rf ${f%.tar.gz} ;\
done
echo "Uploading to S3"
mkdir -p $TRAVIS_BUILD_DIR/build
cd $TRAVIS_BUILD_DIR/build