Build mit Maven & Gradle
authorKai Moritz <kai@juplo.de>
Mon, 27 Jan 2025 23:13:08 +0000 (00:13 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 28 Jan 2025 17:17:52 +0000 (18:17 +0100)
GRADLE.sh [new file with mode: 0755]
MAVEN.sh [new file with mode: 0755]

diff --git a/GRADLE.sh b/GRADLE.sh
new file mode 100755 (executable)
index 0000000..ce562b4
--- /dev/null
+++ b/GRADLE.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+
+source BRANCHES.sh
+
+alias gradle=/opt/gradle/gradle-8.12.1/bin/gradle
+
+for i in $BRANCHES;
+do
+  declare -n branch=${i}
+  git checkout $branch
+  if [ -e 'build.gradle' ]
+  then
+    if [[ $branch =~ "--vorlage" ]]
+    then
+      echo -e "\nIgnoriere Vorlage...\n"
+    else
+      echo -e "\nBuilding $branch"
+      gradle clean
+      gradle buildDockerImage
+    fi
+  else
+    echo -e "\nIgnoriere Branch $branch ohne Projekt...\n"
+  fi
+done
+
+git checkout scripting
diff --git a/MAVEN.sh b/MAVEN.sh
new file mode 100755 (executable)
index 0000000..1b6ac3b
--- /dev/null
+++ b/MAVEN.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+set -e
+
+source BRANCHES.sh
+
+for i in $BRANCHES;
+do
+  declare -n branch=${i}
+  git checkout $branch
+  if [ -e 'pom.xml' ]
+  then
+    if [[ $branch =~ "--vorlage" ]]
+    then
+      echo -e "\nIgnoriere Vorlage...\n"
+    else
+      echo -e "\nBuilding $branch"
+      mvn clean install
+      echo -e "\nPushing Docker image for $branch"
+      mvn docker:push
+    fi
+  else
+    echo -e "\nIgnoriere Branch $branch ohne Projekt...\n"
+  fi
+done
+
+git checkout scripting