From 6283bd74e585475b48e9c25406c330f014587bb6 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 3 Dec 2019 22:30:26 +0100 Subject: [PATCH 1/2] Fix script --- scripts/build-and-deploy.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/build-and-deploy.sh b/scripts/build-and-deploy.sh index a652d91..08f327a 100755 --- a/scripts/build-and-deploy.sh +++ b/scripts/build-and-deploy.sh @@ -14,13 +14,15 @@ # AMO_API_SECRET -||- # don't build if nothing has changed, unless overriden via env variable -if [ ! -z "$GIT_COMMIT" && ! -z "$GIT_PREVIOUS_COMMIT" ] ; then - if [ "$GIT_COMMIT" == "$GIT_PREVIOUS_COMMIT" ] ; then - if [ $FORCE_BUILD == "true" ] ; then - echo "--------------------------------------------" - echo " Nothing has changed. Aborting build." - echo "--------------------------------------------" - exit 0; +if [ ! -z "$GIT_COMMIT" ] ; then + if [ ! -z "$GIT_PREVIOUS_COMMIT" ] ; then + if [ "$GIT_COMMIT" == "$GIT_PREVIOUS_COMMIT" ] ; then + if [ $FORCE_BUILD == "true" ] ; then + echo "--------------------------------------------" + echo " Nothing has changed. Aborting build." + echo "--------------------------------------------" + exit 0; + fi fi fi fi @@ -70,5 +72,5 @@ scp -r ./build-zip/* "ultrawidify-uploader@${RELEASE_SERVER}:${RELEASE_DIRECTORY ###################################### echo "--------------------------------------------" -echo " Nothing has changed. Aborting build." +echo " BUILD FINISHED SUCCESSFULLY" echo "--------------------------------------------" From 18cf4e5d0f83478cf8e4a2e67565cd77cb5e0e61 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 3 Dec 2019 22:39:07 +0100 Subject: [PATCH 2/2] Add logging to build script --- scripts/build-and-deploy.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/build-and-deploy.sh b/scripts/build-and-deploy.sh index 08f327a..d115382 100755 --- a/scripts/build-and-deploy.sh +++ b/scripts/build-and-deploy.sh @@ -13,6 +13,16 @@ # AMO_API_KEY needed if you want to sign and push extension to addons.mozilla.org # AMO_API_SECRET -||- +echo "============= STARTING BUILD SCRIPT =============" +pwd +whoami +echo " ::: env dump" +echo " -> FORCE_BUILD: $FORCE_BUILD" +echo " -> BUILD_SCRIPT: $BUILD_SCRIPT" +echo " -> RELEASE_SERVER: $RELEASE_SERVER" +echo " -> RELEASE_DIRECTORY: $RELEASE_DIRECTORY" +echo " -> BUILD_CHANNEL_DIRECTORY: $BUILD_CHANNEL_DIRECTORY" + # don't build if nothing has changed, unless overriden via env variable if [ ! -z "$GIT_COMMIT" ] ; then if [ ! -z "$GIT_PREVIOUS_COMMIT" ] ; then @@ -29,7 +39,7 @@ fi npm ci -rm -rf /dist-zip || true # no big deal if ./dist-zip doesn't exist +rm -rf ./dist-zip || true # no big deal if ./dist-zip doesn't exist # # build firefox