2023-06-28 12:36:49 +02:00
|
|
|
#!/bin/sh
|
|
|
|
if [ -z "$ANDROID_VERSION_NAME" ] || [ -z "$ANDROID_VERSION_CODE" ]; then echo "Version name or code not specified. Skipping build."; exit 0; fi
|
|
|
|
|
|
|
|
DOCUMENT_ROOT=/var/www/html
|
|
|
|
|
|
|
|
# Build content
|
|
|
|
echo "Building content..."
|
|
|
|
./gradlew --stacktrace assembleRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
|
|
|
./gradlew --stacktrace bundlePlaystoreRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
|
|
|
|
|
|
|
# Take site offline
|
|
|
|
echo "Taking site offline..."
|
|
|
|
touch $DOCUMENT_ROOT/maintenance.file
|
|
|
|
|
|
|
|
# Swap over the content
|
|
|
|
echo "Deploying content..."
|
|
|
|
echo $ANDROID_VERSION_CODE > /var/www/html/fcast-version.txt
|
|
|
|
cp ./app/build/outputs/apk/defaultFlavor/release/app-defaultFlavor-release.apk /var/www/html/fcast-release.apk
|
2023-10-25 13:47:23 -05:00
|
|
|
cp ./app/build/outputs/bundle/playstoreRelease/app-playstore-release.aab /var/www/html/fcast-playstore-release.aab
|