-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
build.sh
executable file
·33 lines (29 loc) · 1.28 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# reactnativecommunity/react-native-android:15.0
BUILDER_IMAGE="reactnativecommunity/react-native-android@sha256:1ffc7741cdcbeb337a389d67e598f331dc3b917e0cd0e0b6341a3f241cd95bb9"
CONTAINER_NAME="zeus_builder_container"
ZEUS_PATH=/olympus/zeus
# Default options for the Docker command
TTY_FLAG="-it"
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--no-tty) TTY_FLAG="" ;; # Remove -it if --no-tty is provided
*) echo "Unknown parameter: $1" && exit 1 ;;
esac
shift
done
# Run the Docker command
docker run --rm $TTY_FLAG --name $CONTAINER_NAME -v "$(pwd):$ZEUS_PATH" $BUILDER_IMAGE bash -c \
'echo -e "\n\n********************************\n*** Building ZEUS...\n********************************\n" && \
cd /olympus/zeus ; yarn install --frozen-lockfile && \
cd /olympus/zeus/android ; ./gradlew app:assembleRelease && \
echo -e "\n\n********************************\n**** APKs and SHA256 Hashes\n********************************\n" && \
cd /olympus/zeus && \
for f in android/app/build/outputs/apk/release/*.apk;
do
RENAMED_FILENAME=$(echo $f | sed -e "s/app-/zeus-/" | sed -e "s/-release-unsigned//")
mv $f $RENAMED_FILENAME
sha256sum $RENAMED_FILENAME
done && \
echo -e "\n" ';