+++ /dev/null
-#!/bin/bash
-set -e
-
-VORLAGEN=../vorlagen
-LIVECODING=../livecoding
-MUSTERLOESUNGEN=../spickzettel
-
-source BRANCHES.sh
-
-if [ "$1" != "" ];
-then
- # Der erste Parameter wird als SUFFIX interpretiert
- git checkout grundlagen/docker--${1}
-else
- git checkout grundlagen/docker
-fi
-mkdir -p $VORLAGEN/grundlagen/docker/
-rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=.gradle --exclude=build --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh --exclude=TAG.sh . $VORLAGEN/grundlagen/docker/
-
-for i in $BRANCHES;
-do
- declare -n branch=${i}
- if [ "$1" != "" ];
- then
- # Der erste Parameter wird als SUFFIX interpretiert
- git checkout $branch--${1}
- else
- git checkout $branch
- fi
- case $branch in
- *--vorlage)
- vorlage=$(echo $branch |sed -e 's/--vorlage$//')
- echo "Vorlage: $vorlage"
- mkdir -p $VORLAGEN/$vorlage/
- rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=.gradle --exclude=build --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh --exclude=TAG.sh . $VORLAGEN/$vorlage/
- ;;
- *--livecoding)
- livecoding=$(echo $branch |sed -e 's/--livecoding$//')
- echo "Live-Coding: $livecoding"
- mkdir -p $LIVECODING/$livecoding/
- rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=.gradle --exclude=build --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh --exclude=TAG.sh . $LIVECODING/$livecoding/
- ;;
- *--livecoding--schritte)
- echo "Ignoriere die Einzelschritte eines Live-Coding: $livecoding"
- ;;
- *)
- echo "Lösung: $branch"
- mkdir -p $MUSTERLOESUNGEN/$branch/
- rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=.gradle --exclude=build --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh --exclude=TAG.sh . $MUSTERLOESUNGEN/$branch/
- ;;
- esac
-done
-
-git checkout scripting
--- /dev/null
+#!/bin/bash
+set -e
+
+VORLAGEN=../vorlagen
+LIVECODING=../livecoding
+MUSTERLOESUNGEN=../spickzettel
+
+source branches.sh
+
+# Optionaler Parameter: Tag-Suffix (kopiert dann den jeweiligen Tag-Stand statt den aktuellen Branch)
+# Optionaler Parameter: --nexus-url=<url> (ruft patch-nexus.sh auf die Vorlagen an)
+TAG_SUFFIX=""
+NEXUS_URL=""
+for arg in "$@"; do
+ case "$arg" in
+ --nexus-url=*) NEXUS_URL="${arg#--nexus-url=}" ;;
+ --*) echo "Unbekannter Parameter: $arg"; exit 1 ;;
+ *) TAG_SUFFIX="$arg" ;;
+ esac
+done
+
+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
+
+RSYNC_OPTS=(
+ rsync -av
+ --exclude=.git
+ --exclude=target
+ --exclude=.idea
+ --exclude=.gradle
+ --exclude=build
+ --exclude=gradle/wrapper/gradle-wrapper.jar
+ --exclude=branches.sh
+ --exclude=build.sh
+ --exclude=copy.sh
+ --exclude=diff.sh
+ --exclude=patch-nexus.sh
+ --exclude=push.sh
+ --exclude=reset.sh
+)
+
+sync_to() {
+ mkdir -p "$1"
+ "${RSYNC_OPTS[@]}" . "$1"
+}
+
+if [ "$TAG_SUFFIX" != "" ]; then
+ git checkout "grundlagen/docker--${TAG_SUFFIX}"
+else
+ git checkout grundlagen/docker
+fi
+sync_to "$VORLAGEN/grundlagen/docker/"
+
+for i in $BRANCHES; do
+ declare -n branch=${i}
+ if [ "$TAG_SUFFIX" != "" ]; then
+ git checkout "${branch}--${TAG_SUFFIX}"
+ else
+ git checkout "$branch"
+ fi
+ case "$branch" in
+ *--livecoding--schritte)
+ echo "Ignoriere Einzelschritte eines Live-Codings: $branch"
+ ;;
+ *--vorlage)
+ vorlage="${branch%--vorlage}"
+ # Sonderfall: technik-check gehört thematisch zu den Grundlagen
+ if [ "$vorlage" = "springkafka/technik-check" ]; then
+ sync_to "$VORLAGEN/grundlagen/technik-check/"
+ else
+ sync_to "$VORLAGEN/$vorlage/"
+ fi
+ ;;
+ *--livecoding)
+ livecoding="${branch%--livecoding}"
+ sync_to "$LIVECODING/$livecoding/"
+ ;;
+ *)
+ sync_to "$MUSTERLOESUNGEN/$branch/"
+ ;;
+ esac
+done
+
+if [ "$NEXUS_URL" != "" ]; then
+ echo -e "\nPatche Gradle-Setups für Nexus: $NEXUS_URL"
+ (cd "$VORLAGEN" && "$SCRIPT_DIR/patch-nexus.sh" "$NEXUS_URL")
+fi
+
+git checkout scripting