]> Untitled Git - godot-builder.git/commitdiff
version 0.2.0 0.2.0
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Thu, 13 Mar 2025 10:48:42 +0000 (05:48 -0500)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Thu, 13 Mar 2025 11:30:09 +0000 (06:30 -0500)
* Added project ID for each build based on project name, branch name, and commit hash
* Build zips and shasums for each

.gitignore [new file with mode: 0644]
Dockerfile
docker-compose.yml
entrypoint.sh

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1377554
--- /dev/null
@@ -0,0 +1 @@
+*.swp
index dcc7de778441b4f13c615d7da531043394d9d778..49ef939425a3d1afdd67848413897003e5bd1ac1 100644 (file)
@@ -1,5 +1,7 @@
 FROM cjpalmer/godot:0.1.0
 
 FROM cjpalmer/godot:0.1.0
 
+RUN apt update -y && apt install -y zip
+
 ADD ./entrypoint.sh .
 
 ENTRYPOINT [ "./entrypoint.sh" ]
 ADD ./entrypoint.sh .
 
 ENTRYPOINT [ "./entrypoint.sh" ]
index e6a35d3308190519ecda8beaa4800f495690572e..094e53b8c1793c364a233e0015216b921e0a62b7 100644 (file)
@@ -2,7 +2,7 @@ version: '3'
 services:
     godot-builder:
         build: .
 services:
     godot-builder:
         build: .
-        image: cjpalmer/godot-builder:0.1.0
+        image: cjpalmer/godot-builder:0.2.0
         volumes:
         - godot-build:/build
         - godot-project:/project
         volumes:
         - godot-build:/build
         - godot-project:/project
index 27c3ef5909811d19e686f817acca69c69be19edc..c320ad09809ec9dbaed4449c1387afcb0a47b4f6 100755 (executable)
@@ -6,6 +6,7 @@
 
 [[ -z "$URI_PROJECT_SNAPSHOT" ]] && echo No URI_PROJECT_SNAPSHOT, exiting && exit 1
 
 
 [[ -z "$URI_PROJECT_SNAPSHOT" ]] && echo No URI_PROJECT_SNAPSHOT, exiting && exit 1
 
+echo --------------------------------------------------------------------------------
 echo Getting project - $URI_PROJECT_SNAPSHOT
 
 DIR_BUILD=/build
 echo Getting project - $URI_PROJECT_SNAPSHOT
 
 DIR_BUILD=/build
@@ -16,19 +17,20 @@ wget $URI_PROJECT_SNAPSHOT && \
     rm *.tar.gz
 
 DIR_PROJECT=$(find $DIR_PROJECT_ROOT -type f -name project.godot | sed 's|/project.godot||')
     rm *.tar.gz
 
 DIR_PROJECT=$(find $DIR_PROJECT_ROOT -type f -name project.godot | sed 's|/project.godot||')
+PROJECT_ID=$(echo $DIR_PROJECT | awk -F/ '{print $NF}')
 
 echo Project directory - $DIR_PROJECT
 
 ################################################################################
 # execute project build
 
 
 echo Project directory - $DIR_PROJECT
 
 ################################################################################
 # execute project build
 
-DIR_DEBUG=$DIR_BUILD/debug
-DIR_RELEASE=$DIR_BUILD/release
+DIR_DEBUG=$DIR_BUILD/$PROJECT_ID/debug
+DIR_RELEASE=$DIR_BUILD/$PROJECT_ID/release
 
 
-GODOT="godot"
-GODOT_OPTS="--headless --path $DIR_PROJECT"
+GODOT="godot --headless --path $DIR_PROJECT"
 EXPORT_PRESETS_CFG="$DIR_PROJECT/export_presets.cfg"
 
 EXPORT_PRESETS_CFG="$DIR_PROJECT/export_presets.cfg"
 
+echo --------------------------------------------------------------------------------
 echo Godot version - $($GODOT --headless --version)
 
 # iterate through all build types present in config file
 echo Godot version - $($GODOT --headless --version)
 
 # iterate through all build types present in config file
@@ -42,7 +44,7 @@ fi
 
 for EXPORT_NAME in $EXPORT_NAMES
 do
 
 for EXPORT_NAME in $EXPORT_NAMES
 do
-    echo
+    echo --------------------------------------------------------------------------------
     echo Starting project build for export $EXPORT_NAME
 
     # create build folders
     echo Starting project build for export $EXPORT_NAME
 
     # create build folders
@@ -54,9 +56,38 @@ do
         '$1=="name" && $2~name{f=1} f==1 && $1=="export_path"{print $2;exit}' \
         $EXPORT_PRESETS_CFG | sed -e 's|^.*/||' -e 's/"//g')
 
         '$1=="name" && $2~name{f=1} f==1 && $1=="export_path"{print $2;exit}' \
         $EXPORT_PRESETS_CFG | sed -e 's|^.*/||' -e 's/"//g')
 
-    # do build!
-    echo $GODOT $GODOT_OPTS --export-debug "$EXPORT_NAME" $DIR_DEBUG/$EXPORT_NAME/$EXPORT_FNAME
-    $GODOT $GODOT_OPTS --export-debug "$EXPORT_NAME" $DIR_DEBUG/$EXPORT_NAME/$EXPORT_FNAME
-    echo $GODOT $GODOT_OPTS --export-release "$EXPORT_NAME" $DIR_RELEASE/$EXPORT_NAME/$EXPORT_FNAME
-    $GODOT $GODOT_OPTS --export-release "$EXPORT_NAME" $DIR_RELEASE/$EXPORT_NAME/$EXPORT_FNAME
+    DEBUG_BUILD_PATH=$DIR_DEBUG/$EXPORT_NAME/$EXPORT_FNAME
+    RELEASE_BUILD_PATH=$DIR_RELEASE/$EXPORT_NAME/$EXPORT_FNAME
+
+    ######
+    # do debug and release builds!
+    echo $GODOT --export-debug "$EXPORT_NAME" $DEBUG_BUILD_PATH
+    $GODOT --export-debug "$EXPORT_NAME" $DEBUG_BUILD_PATH
+
+    echo $GODOT --export-release "$EXPORT_NAME" $RELEASE_BUILD_PATH
+    $GODOT --export-release "$EXPORT_NAME" $RELEASE_BUILD_PATH
+
+    ######
+    # zip debug and release builds and shasum them
+    for DIR in $DIR_DEBUG $DIR_RELEASE
+    do
+        ZIP_PATH=$DIR/$EXPORT_NAME
+        echo
+        echo Zipping $ZIP_PATH
+        zip $EXPORT_NAME $ZIP_PATH && mv *.zip $DIR
+    done
 done
 done
+
+echo --------------------------------------------------------------------------------
+echo Computing shasums for zip files
+
+for DIR in $DIR_DEBUG $DIR_RELEASE
+do
+    $(cd $DIR && sha1sum *.zip >shasum.txt)
+
+    echo
+    echo SHASUM from $DIR -
+
+    find $DIR -type f -name shasum.txt | xargs cat
+done
+