BuildRelease.sh: Add an option to build the ipa from local source code copy

This commit is contained in:
manuroe
2021-12-09 13:46:33 +01:00
parent 25a395cc25
commit 14a06f9804
2 changed files with 19 additions and 1 deletions

View File

@@ -21,6 +21,8 @@ TAG=$1
BUILD_DIR="build"/$TAG
BUILD_NUMBER=$( date +%Y%m%d%H%M%S )
# Enable this flag to build the ipa from the current local source code. Not git clone
# LOCAL_SOURCE=true
if [ -e $BUILD_DIR ]; then
echo "Error: Folder ${BUILD_DIR} already exists"
@@ -32,7 +34,17 @@ mkdir -p $BUILD_DIR
cd $BUILD_DIR
REPO_URL=$(git ls-remote --get-url origin)
REPO_NAME=$(basename -s .git $REPO_URL)
if [ "$LOCAL_SOURCE" = true ]; then
echo "Reuse source code of the local copy..."
rm -rf /tmp/$REPO_NAME
cp -R ../../../.. /tmp/$REPO_NAME
mv /tmp/$REPO_NAME .
else
echo "Git clone $REPO_URL with branch/tag $TAG..."
git clone $REPO_URL --depth=1 --branch $TAG
fi
cd $REPO_NAME
# Fastlane update
@@ -44,7 +56,9 @@ bundle update
bundle exec fastlane update_plugins
# Use appropriated dependencies according to the current branch
if [ "$LOCAL_SOURCE" != true ]; then
bundle exec fastlane point_dependencies_to_same_feature
fi
# Build
bundle exec fastlane app_store build_number:$BUILD_NUMBER git_tag:$TAG