Skip to content

Commit

Permalink
Passing the $PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
markgravity committed Jul 14, 2023
1 parent 0469e02 commit 03d53e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.git/
.git/
/.idea
39 changes: 8 additions & 31 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/"

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fi
cat <<EOF
---
default_process_types:
web: /app/dart-sdk/bin/dart pub global run dhttpd --host 0.0.0.0 --path ${DEPLOY_DIR}
web: /app/dart-sdk/bin/dart pub global run dhttpd --host=0.0.0.0 --path=${DEPLOY_DIR} --port=\$PORT
EOF

0 comments on commit 03d53e1

Please sign in to comment.