From ceaf9cdf9652ac0633dc7d451fe5920ce914b99e Mon Sep 17 00:00:00 2001 From: Huzaifa Asif Date: Thu, 10 Dec 2020 14:47:29 +0500 Subject: [PATCH 01/28] fix bash error https://stackoverflow.com/questions/13617843/unary-operator-expected-error-in-bash-if-condition --- bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index b929fef..f0071cc 100644 --- a/bin/compile +++ b/bin/compile @@ -36,7 +36,7 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR -if [ -d $CACHE_DIR/flutter ]; then +if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" cp -R $CACHE_DIR/flutter $BUILD_DIR else @@ -60,7 +60,7 @@ if [ -n "$FLUTTER_VERSION" ]; then else print "Running flutter upgrade command" - if [ $channel != "beta" ]; then + if [ "$channel" != "beta" ]; then flutter/bin/flutter channel beta | indent fi From 203ccb65e7584969af7289b7e13d3f70f29205a4 Mon Sep 17 00:00:00 2001 From: Huzaifa Asif Date: Thu, 10 Dec 2020 15:01:35 +0500 Subject: [PATCH 02/28] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0500e6a..799d21e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +This Fork fixes a minor bug ([ceaf9cd](https://github.com/cybrnode/heroku-buildpack-flutter/commit/ceaf9cdf9652ac0633dc7d451fe5920ce914b99e)) in [bin/compile](bin/compile): # Heroku Buildpack for Flutter ![header](https://user-images.githubusercontent.com/38699812/89092029-fb5b8400-d373-11ea-8ac0-6a46c817ae3b.png) Automate your deployments on Heroku easily. From 9c166b817eaa2bf29011210acf0f392bebc9b42c Mon Sep 17 00:00:00 2001 From: Diego Zepeda <38699812+diezep@users.noreply.github.com> Date: Sun, 17 Jan 2021 15:11:50 -0600 Subject: [PATCH 03/28] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 799d21e..0500e6a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -This Fork fixes a minor bug ([ceaf9cd](https://github.com/cybrnode/heroku-buildpack-flutter/commit/ceaf9cdf9652ac0633dc7d451fe5920ce914b99e)) in [bin/compile](bin/compile): # Heroku Buildpack for Flutter ![header](https://user-images.githubusercontent.com/38699812/89092029-fb5b8400-d373-11ea-8ac0-6a46c817ae3b.png) Automate your deployments on Heroku easily. From 88cb26a56b875d6613fbecaf62eabf9266533131 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 13:04:07 +0100 Subject: [PATCH 04/28] set deploy and build dir --- bin/compile | 6 +++++- bin/release | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/compile b/bin/compile index f0071cc..ca9977f 100644 --- a/bin/compile +++ b/bin/compile @@ -25,8 +25,12 @@ function export_env_dir() { function indent() { sed -u 's/^/ /' } +if [ -n "$FLUTTER_BUILD_DIR" ]; then + BUILD_DIR="$FLUTTER_BUILD_DIR" +else + BUILD_DIR=${1:-} +fi -BUILD_DIR=${1:-} CACHE_DIR=${2:-} export_env_dir "$3" diff --git a/bin/release b/bin/release index 4caa207..2143cc3 100644 --- a/bin/release +++ b/bin/release @@ -1,11 +1,23 @@ #!/bin/sh -BUILD_DIR=${1:-} +if [ -n "$FLUTTER_BUILD_DIR" ]; then + BUILD_DIR="$FLUTTER_BUILD_DIR" +else + BUILD_DIR=${1:-} +fi + +if [ -n "$FLUTTER_DEPLOY_DIR" ]; then + FLUTTER_DEPLOY_DIR_BASE="$FLUTTER_DEPLOY_DIR" +else + FLUTTER_DEPLOY_DIR_BASE="/app" +fi + + # If the FLUTTER_CLEANUP is in false, or in true. if [ -d $BUILD_DIR/build/web ]; then - DEPLOY_DIR="/app/build/web/" + DEPLOY_DIR="$FLUTTER_DEPLOY_DIR_BASE/build/web/" else - DEPLOY_DIR="/app/" + DEPLOY_DIR="$FLUTTER_DEPLOY_DIR_BASE/" fi cat < Date: Wed, 24 Feb 2021 14:44:15 +0100 Subject: [PATCH 05/28] Add pwd for test --- bin/compile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/compile b/bin/compile index ca9977f..c7c6597 100644 --- a/bin/compile +++ b/bin/compile @@ -40,6 +40,9 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR +echo "-----> PWD:" +pwd + if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" cp -R $CACHE_DIR/flutter $BUILD_DIR From 58dc21b829f87191d6585c1bfe8d457e947b481c Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 14:54:12 +0100 Subject: [PATCH 06/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index c7c6597..545e2a1 100644 --- a/bin/compile +++ b/bin/compile @@ -41,7 +41,7 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR echo "-----> PWD:" -pwd +echo "$BUILD_DIR" if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" From 128f2ca1eebc58a02c2b2ff3711fe849a1d541b1 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 14:58:12 +0100 Subject: [PATCH 07/28] test --- bin/compile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 545e2a1..e5c4b17 100644 --- a/bin/compile +++ b/bin/compile @@ -40,8 +40,10 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR -echo "-----> PWD:" -echo "$BUILD_DIR" +echo "TEST" +echo "ls $(ls)" +echo "build dir $BUILD_DIR" +echo "flutter build dir $FLUTTER_BUILD_DIR" if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" From 70b96984ede55a6ae5e36da7edac0f4fddf4c0ea Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:00:00 +0100 Subject: [PATCH 08/28] test --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index e5c4b17..92989e8 100644 --- a/bin/compile +++ b/bin/compile @@ -27,6 +27,7 @@ function indent() { } if [ -n "$FLUTTER_BUILD_DIR" ]; then BUILD_DIR="$FLUTTER_BUILD_DIR" + echo "asdfasdfasdf" else BUILD_DIR=${1:-} fi From 4c8e754851e13da936b4243284baee80e7dd4a1d Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:03:35 +0100 Subject: [PATCH 09/28] test --- bin/compile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bin/compile b/bin/compile index 92989e8..576cf8d 100644 --- a/bin/compile +++ b/bin/compile @@ -25,13 +25,7 @@ function export_env_dir() { function indent() { sed -u 's/^/ /' } -if [ -n "$FLUTTER_BUILD_DIR" ]; then - BUILD_DIR="$FLUTTER_BUILD_DIR" - echo "asdfasdfasdf" -else - BUILD_DIR=${1:-} -fi - +BUILD_DIR="$FLUTTER_BUILD_DIR" CACHE_DIR=${2:-} export_env_dir "$3" @@ -42,8 +36,6 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR echo "TEST" -echo "ls $(ls)" -echo "build dir $BUILD_DIR" echo "flutter build dir $FLUTTER_BUILD_DIR" if [ -d "$CACHE_DIR/flutter" ]; then From 8f0e33182cf876685c2404236dfd3d7dd0fb8f2d Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:13:12 +0100 Subject: [PATCH 10/28] test --- bin/compile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 576cf8d..b62fe63 100644 --- a/bin/compile +++ b/bin/compile @@ -25,7 +25,7 @@ function export_env_dir() { function indent() { sed -u 's/^/ /' } -BUILD_DIR="$FLUTTER_BUILD_DIR" +BUILD_DIR="frontend/flutter_desktop_test" CACHE_DIR=${2:-} export_env_dir "$3" @@ -36,7 +36,6 @@ mkdir -p $CACHE_DIR cd $BUILD_DIR echo "TEST" -echo "flutter build dir $FLUTTER_BUILD_DIR" if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" From 9a82d5edfa7810b554449ded7929c6ab72fcfcb0 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:14:29 +0100 Subject: [PATCH 11/28] test --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index b62fe63..f6bccfb 100644 --- a/bin/compile +++ b/bin/compile @@ -32,6 +32,7 @@ export_env_dir "$3" # Create the cache directory if not exist. mkdir -p $CACHE_DIR +ls cd $BUILD_DIR From 5cc8e94fa67c5c9171770dbc8709bc27edc1c604 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:18:32 +0100 Subject: [PATCH 12/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index f6bccfb..c3c5734 100644 --- a/bin/compile +++ b/bin/compile @@ -25,7 +25,7 @@ function export_env_dir() { function indent() { sed -u 's/^/ /' } -BUILD_DIR="frontend/flutter_desktop_test" +BUILD_DIR="bin/ump_legal_counsel/frontend/flutter_desktop_test" CACHE_DIR=${2:-} export_env_dir "$3" From 2aa1a9b4fe25e3762571c9d6113c17b24f9895bb Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:25:15 +0100 Subject: [PATCH 13/28] test --- bin/compile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/compile b/bin/compile index c3c5734..473ea75 100644 --- a/bin/compile +++ b/bin/compile @@ -25,18 +25,16 @@ function export_env_dir() { function indent() { sed -u 's/^/ /' } -BUILD_DIR="bin/ump_legal_counsel/frontend/flutter_desktop_test" +BUILD_DIR=${1:-} CACHE_DIR=${2:-} export_env_dir "$3" # Create the cache directory if not exist. mkdir -p $CACHE_DIR -ls cd $BUILD_DIR - -echo "TEST" +ls -la if [ -d "$CACHE_DIR/flutter" ]; then print "Restoring Flutter SDK from CACHE" From dcf6a406ab41df2cc49017b59fc7d5d7576a3493 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:30:59 +0100 Subject: [PATCH 14/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 473ea75..a0073f7 100644 --- a/bin/compile +++ b/bin/compile @@ -33,7 +33,7 @@ export_env_dir "$3" # Create the cache directory if not exist. mkdir -p $CACHE_DIR -cd $BUILD_DIR +cd $BUILD_DIR/$FLUTTER_BUILD_DIR ls -la if [ -d "$CACHE_DIR/flutter" ]; then From a5fab006d2b0101567edf42dcf7a4f2c3b96141f Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:45:05 +0100 Subject: [PATCH 15/28] test --- bin/compile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/compile b/bin/compile index a0073f7..faa3615 100644 --- a/bin/compile +++ b/bin/compile @@ -34,15 +34,11 @@ export_env_dir "$3" mkdir -p $CACHE_DIR cd $BUILD_DIR/$FLUTTER_BUILD_DIR -ls -la -if [ -d "$CACHE_DIR/flutter" ]; then - print "Restoring Flutter SDK from CACHE" - cp -R $CACHE_DIR/flutter $BUILD_DIR -else - print "Installing SDK from Github repository." - git clone https://github.com/flutter/flutter.git --quiet -fi + +print "Installing SDK from Github repository." +git clone https://github.com/flutter/flutter.git --quiet + # Check if FLUTTER_VERSION variables is set. if [ -n "$FLUTTER_VERSION" ]; then From e6778320bd2be2b591d09151767603e770850132 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:53:05 +0100 Subject: [PATCH 16/28] test --- bin/compile | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/bin/compile b/bin/compile index faa3615..3782a52 100644 --- a/bin/compile +++ b/bin/compile @@ -32,13 +32,16 @@ export_env_dir "$3" # Create the cache directory if not exist. mkdir -p $CACHE_DIR +APP_DIR=$BUILD_DIR/$FLUTTER_BUILD_DIR +cd "$APP_DIR" -cd $BUILD_DIR/$FLUTTER_BUILD_DIR - - -print "Installing SDK from Github repository." -git clone https://github.com/flutter/flutter.git --quiet - +if [ -d "$CACHE_DIR/flutter" ]; then + print "Restoring Flutter SDK from CACHE" + cp -R $CACHE_DIR/flutter $APP_DIR +else + print "Installing SDK from Github repository." + git clone https://github.com/flutter/flutter.git --quiet +fi # Check if FLUTTER_VERSION variables is set. if [ -n "$FLUTTER_VERSION" ]; then @@ -88,9 +91,9 @@ mkdir -p $PUB_CACHE if [ -x flutter/bin/flutter ]; then print "Saving Flutter SDK in Cache" rm -rf $CACHE_DIR/flutter - cp -R $BUILD_DIR/flutter $CACHE_DIR/flutter - mv $BUILD_DIR/flutter/bin/cache/dart-sdk/ $BUILD_DIR - rm -rf $BUILD_DIR/flutter + cp -R APP_DIR/flutter $CACHE_DIR/flutter + mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR + rm -rf $APP_DIR/flutter fi # To read hidden directories and use move with exclusion. @@ -99,11 +102,11 @@ shopt -s extglob # Check FLUTTER_CLEANUP var to delete all files or keep it. if [ "$FLUTTER_CLEANUP" != false ]; then - mkdir -p $BUILD_DIR/TO_DELETE + mkdir -p $APP_DIR/TO_DELETE mv !("TO_DELETE") TO_DELETE - mv TO_DELETE/build/web/* $BUILD_DIR - mv TO_DELETE/dart-sdk $BUILD_DIR + mv TO_DELETE/build/web/* $APP_DIR + mv TO_DELETE/dart-sdk $APP_DIR rm -rf TO_DELETE fi @@ -117,7 +120,7 @@ if [ -d "$CACHE_DIR/.pub-cache/" ]; then cp -R $CACHE_DIR/.pub-cache/* $PUB_CACHE else print "Getting dhttpd to run web service." - $BUILD_DIR/dart-sdk/bin/dart pub global activate -sgit https://github.com/diezep/dhttpd.git | indent + $APP_DIR/dart-sdk/bin/dart pub global activate -sgit https://github.com/diezep/dhttpd.git | indent print "Getting dhtppd to run web service." mkdir -p $CACHE_DIR/.pub-cache/ @@ -126,7 +129,7 @@ fi # Moving to the build, after running the compile. All will be deleted and removed to app directory. # Copying the result, the files will be kept in storage. -cp -R $PUB_CACHE $BUILD_DIR +cp -R $PUB_CACHE $APP_DIR export PATH="$PATH":"/app/dart-sdk/bin/" export PATH="$PATH":"/app/.pub-cache/bin" From b79ebebdbae62298581cacb5898a80ae64d1fd76 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 15:55:37 +0100 Subject: [PATCH 17/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 3782a52..b1de6e5 100644 --- a/bin/compile +++ b/bin/compile @@ -91,7 +91,7 @@ mkdir -p $PUB_CACHE if [ -x flutter/bin/flutter ]; then print "Saving Flutter SDK in Cache" rm -rf $CACHE_DIR/flutter - cp -R APP_DIR/flutter $CACHE_DIR/flutter + cp -R $APP_DIR/flutter $CACHE_DIR/flutter mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR rm -rf $APP_DIR/flutter fi From a327da63791f00c3b1a9a66179cca1537ebad0fc Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 16:14:43 +0100 Subject: [PATCH 18/28] test --- bin/release | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/bin/release b/bin/release index 2143cc3..b2c2175 100644 --- a/bin/release +++ b/bin/release @@ -1,23 +1,16 @@ #!/bin/sh -if [ -n "$FLUTTER_BUILD_DIR" ]; then - BUILD_DIR="$FLUTTER_BUILD_DIR" -else - BUILD_DIR=${1:-} -fi - +BUILD_DIR=${1:-} if [ -n "$FLUTTER_DEPLOY_DIR" ]; then - FLUTTER_DEPLOY_DIR_BASE="$FLUTTER_DEPLOY_DIR" + DEPLOY_DIR="$FLUTTER_DEPLOY_DIR" else - FLUTTER_DEPLOY_DIR_BASE="/app" -fi - -# If the FLUTTER_CLEANUP is in false, or in true. -if [ -d $BUILD_DIR/build/web ]; then - DEPLOY_DIR="$FLUTTER_DEPLOY_DIR_BASE/build/web/" -else - DEPLOY_DIR="$FLUTTER_DEPLOY_DIR_BASE/" + # If the FLUTTER_CLEANUP is in false, or in true. + if [ -d $BUILD_DIR/build/web ]; then + DEPLOY_DIR="/app/build/web/" + else + DEPLOY_DIR="/app/" + fi fi cat < Date: Wed, 24 Feb 2021 16:20:53 +0100 Subject: [PATCH 19/28] test --- bin/compile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/compile b/bin/compile index b1de6e5..80f9afd 100644 --- a/bin/compile +++ b/bin/compile @@ -131,5 +131,9 @@ fi # Copying the result, the files will be kept in storage. cp -R $PUB_CACHE $APP_DIR +if [ -n "$FLUTTER_DEPLOY_DIR" ]; then + cp "$APP_DIR" "$FLUTTER_DEPLOY_DIR" +fi + export PATH="$PATH":"/app/dart-sdk/bin/" export PATH="$PATH":"/app/.pub-cache/bin" From dbc8ed670885bff86af4e770a2b79457e6bc0694 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 16:24:44 +0100 Subject: [PATCH 20/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 80f9afd..a9c5031 100644 --- a/bin/compile +++ b/bin/compile @@ -132,7 +132,7 @@ fi cp -R $PUB_CACHE $APP_DIR if [ -n "$FLUTTER_DEPLOY_DIR" ]; then - cp "$APP_DIR" "$FLUTTER_DEPLOY_DIR" + cp -r "$APP_DIR" "$FLUTTER_DEPLOY_DIR" fi export PATH="$PATH":"/app/dart-sdk/bin/" From a3cecaf4770d9863ce9c01646abb9a75123e311d Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 16:31:08 +0100 Subject: [PATCH 21/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index a9c5031..549fae3 100644 --- a/bin/compile +++ b/bin/compile @@ -132,7 +132,7 @@ fi cp -R $PUB_CACHE $APP_DIR if [ -n "$FLUTTER_DEPLOY_DIR" ]; then - cp -r "$APP_DIR" "$FLUTTER_DEPLOY_DIR" + cp -r "$APP_DIR" "$BUILD_DIR/$FLUTTER_DEPLOY_DIR" fi export PATH="$PATH":"/app/dart-sdk/bin/" From 8b665ed360fe5466e81005975955edd89a65506e Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 16:51:18 +0100 Subject: [PATCH 22/28] test --- bin/compile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 549fae3..ebb78b3 100644 --- a/bin/compile +++ b/bin/compile @@ -32,7 +32,11 @@ export_env_dir "$3" # Create the cache directory if not exist. mkdir -p $CACHE_DIR -APP_DIR=$BUILD_DIR/$FLUTTER_BUILD_DIR +if [ -n "$FLUTTER_BUILD_DIR" ]; then + APP_DIR=$BUILD_DIR/$FLUTTER_BUILD_DIR +else + APP_DIR=$BUILD_DIR +fi cd "$APP_DIR" if [ -d "$CACHE_DIR/flutter" ]; then @@ -92,7 +96,7 @@ if [ -x flutter/bin/flutter ]; then print "Saving Flutter SDK in Cache" rm -rf $CACHE_DIR/flutter cp -R $APP_DIR/flutter $CACHE_DIR/flutter - mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR +# mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR rm -rf $APP_DIR/flutter fi From 8db40888f46428a61532bf6913d4807093331ad3 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Wed, 24 Feb 2021 16:55:38 +0100 Subject: [PATCH 23/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index ebb78b3..598ea33 100644 --- a/bin/compile +++ b/bin/compile @@ -96,7 +96,7 @@ if [ -x flutter/bin/flutter ]; then print "Saving Flutter SDK in Cache" rm -rf $CACHE_DIR/flutter cp -R $APP_DIR/flutter $CACHE_DIR/flutter -# mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR + mv $APP_DIR/flutter/bin/cache/dart-sdk/ $APP_DIR rm -rf $APP_DIR/flutter fi From af0bf9e198498e99b1576dd71f1fff70060ca984 Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Thu, 25 Feb 2021 11:31:49 +0100 Subject: [PATCH 24/28] test --- bin/compile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/compile b/bin/compile index 598ea33..f124a82 100644 --- a/bin/compile +++ b/bin/compile @@ -139,5 +139,7 @@ if [ -n "$FLUTTER_DEPLOY_DIR" ]; then cp -r "$APP_DIR" "$BUILD_DIR/$FLUTTER_DEPLOY_DIR" fi +du -hsc "$(pwd)" + export PATH="$PATH":"/app/dart-sdk/bin/" export PATH="$PATH":"/app/.pub-cache/bin" From ed6d893049cb1dc6bcd25611d307bf19eccc040c Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Thu, 25 Feb 2021 12:01:42 +0100 Subject: [PATCH 25/28] test --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index f124a82..f8708be 100644 --- a/bin/compile +++ b/bin/compile @@ -139,7 +139,7 @@ if [ -n "$FLUTTER_DEPLOY_DIR" ]; then cp -r "$APP_DIR" "$BUILD_DIR/$FLUTTER_DEPLOY_DIR" fi -du -hsc "$(pwd)" +du -h -d 2 | sort -n export PATH="$PATH":"/app/dart-sdk/bin/" export PATH="$PATH":"/app/.pub-cache/bin" From 0469e02da37789030fb4c2944e40b5232608b79c Mon Sep 17 00:00:00 2001 From: Kamil Radomski Date: Thu, 25 Feb 2021 12:25:03 +0100 Subject: [PATCH 26/28] test --- bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index f8708be..ca4b834 100644 --- a/bin/compile +++ b/bin/compile @@ -141,5 +141,5 @@ fi du -h -d 2 | sort -n -export PATH="$PATH":"/app/dart-sdk/bin/" -export PATH="$PATH":"/app/.pub-cache/bin" +export PATH="$PATH":"/$APP_DIR/dart-sdk/bin/" +export PATH="$PATH":"/$APP_DIR/.pub-cache/bin" From 03d53e1078228bbd2b8475bcf93f2acf8709bf39 Mon Sep 17 00:00:00 2001 From: MarkG Date: Thu, 13 Jul 2023 15:31:00 +0700 Subject: [PATCH 27/28] Passing the $PORT --- .gitignore | 3 ++- bin/compile | 39 ++++++++------------------------------- bin/release | 2 +- 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 4032ec6..bd0b92f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.git/ \ No newline at end of file +.git/ +/.idea diff --git a/bin/compile b/bin/compile index ca4b834..8d2eceb 100644 --- a/bin/compile +++ b/bin/compile @@ -44,30 +44,7 @@ if [ -d "$CACHE_DIR/flutter" ]; then cp -R $CACHE_DIR/flutter $APP_DIR else print "Installing SDK from Github repository." - git clone https://github.com/flutter/flutter.git --quiet -fi - -# Check if FLUTTER_VERSION variables is set. -if [ -n "$FLUTTER_VERSION" ]; then - # Load bash variables from flutter --machine --version and read it like $FLUTTER_VERSION variable. - flutter/bin/flutter --machine --version >flutter.json - FLUTTER_INSTALLED_VERSION=$(grep -o '"frameworkVersion": *"[^"]*' flutter.json | grep -o '[^"]*$') - - # Check if the FLUTTER_VERSION is the same with the installed one. - if [ "$FLUTTER_VERSION" != "$FLUTTER_INSTALLED_VERSION" ]; then - print "Installing Flutter SDK version : $FLUTTER_VERSION" - flutter/bin/flutter version $FLUTTER_VERSION --quiet | indent - fi - rm flutter.json - -else - - print "Running flutter upgrade command" - if [ "$channel" != "beta" ]; then - flutter/bin/flutter channel beta | indent - fi - - flutter/bin/flutter upgrade --quiet | indent + git clone https://github.com/flutter/flutter.git --branch $FLUTTER_VERSION --quiet --single-branch | indent fi print "Enabling Web support" @@ -77,7 +54,7 @@ print "Running flutter clean command." flutter/bin/flutter clean --quiet | indent print "Getting packages from Flutter project" -flutter/bin/flutter pub get --quiet | indent +flutter/bin/flutter pub get | indent PATH="$PATH":"$(pwd)/flutter/bin/" @@ -119,17 +96,17 @@ fi # Is taken from my Github repo because some variables need to be changed every run # like PORT from environment. -if [ -d "$CACHE_DIR/.pub-cache/" ]; then - print "dhttpd Found in cache. Restoring." - cp -R $CACHE_DIR/.pub-cache/* $PUB_CACHE -else +#if [ -d "$CACHE_DIR/.pub-cache/" ]; then +# print "dhttpd Found in cache. Restoring." +# cp -R $CACHE_DIR/.pub-cache/* $PUB_CACHE +#else print "Getting dhttpd to run web service." - $APP_DIR/dart-sdk/bin/dart pub global activate -sgit https://github.com/diezep/dhttpd.git | indent + $APP_DIR/dart-sdk/bin/dart pub global activate dhttpd | indent print "Getting dhtppd to run web service." mkdir -p $CACHE_DIR/.pub-cache/ cp -R $PUB_CACHE/* $CACHE_DIR/.pub-cache/ -fi +#fi # Moving to the build, after running the compile. All will be deleted and removed to app directory. # Copying the result, the files will be kept in storage. diff --git a/bin/release b/bin/release index b2c2175..0dc9b76 100644 --- a/bin/release +++ b/bin/release @@ -16,6 +16,6 @@ fi cat < Date: Wed, 19 Jul 2023 16:29:28 +0700 Subject: [PATCH 28/28] Support .env --- bin/compile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/compile b/bin/compile index 8d2eceb..d2a7dc0 100644 --- a/bin/compile +++ b/bin/compile @@ -47,6 +47,12 @@ else git clone https://github.com/flutter/flutter.git --branch $FLUTTER_VERSION --quiet --single-branch | indent fi +if [ -n "$FLUTTER_ENV_FILE" ]; then + print "Generate .env file" + touch .env + echo $FLUTTER_ENV_FILE | base64 --decode > .env +fi + print "Enabling Web support" flutter/bin/flutter config --enable-web --quiet | indent