From e1514c2ab791065bec8bf07cf9dbd7d2c218ecd4 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 14 Dec 2021 18:55:02 +0100 Subject: [PATCH 1/1] =?utf8?q?Initiale=20Version=20des=20Scriptings=20zur?= =?utf8?q?=20automatisch=20Aktualisierung=20der=20=C3=9Cbung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- BRANCHES.sh | 30 ++++++++++++++++++++++++++++++ BUILD.sh | 24 ++++++++++++++++++++++++ DIFF.sh | 11 +++++++++++ PUSH.sh | 13 +++++++++++++ REBASE.sh | 12 ++++++++++++ RESET.sh | 12 ++++++++++++ 6 files changed, 102 insertions(+) create mode 100755 BRANCHES.sh create mode 100755 BUILD.sh create mode 100755 DIFF.sh create mode 100755 PUSH.sh create mode 100755 REBASE.sh create mode 100755 RESET.sh diff --git a/BRANCHES.sh b/BRANCHES.sh new file mode 100755 index 0000000..ca40dc1 --- /dev/null +++ b/BRANCHES.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +config__flawed_setup__zookeeper=config/flawed-setup--zookeeper +config__flawed_setup__zookeeper__ROOT=grundlagen/docker +grundlagen__simple_producer=grundlagen/simple-producer +grundlagen__simple_producer__ROOT=grundlagen/docker +grundlagen__simple_producer__vorlage=grundlagen/simple-producer--vorlage +grundlagen__simple_producer__vorlage__ROOT=grundlagen/simple-producer +grundlagen__simple_consumer=grundlagen/simple-consumer +grundlagen__simple_consumer__ROOT=grundlagen/simple-producer +grundlagen__simple_consumer__vorlage=grundlagen/simple-consumer--vorlage +grundlagen__simple_consumer__vorlage__ROOT=grundlagen/simple-consumer +producer__spring_producer=producer/spring-producer +producer__spring_producer__ROOT=grundlagen/simple-producer +producer__rest_producer=producer/rest-producer +producer__rest_producer__ROOT=producer/spring-producer +consumer__spring_consumer=consumer/spring-consumer +consumer__spring_consumer__ROOT=grundlagen/simple-consumer + +BRANCHES="\ + config__flawed_setup__zookeeper \ + grundlagen__simple_producer \ + grundlagen__simple_producer__vorlage \ + grundlagen__simple_consumer \ + grundlagen__simple_consumer__vorlage \ + producer__spring_producer \ + producer__rest_producer \ + consumer__spring_consumer \ + " diff --git a/BUILD.sh b/BUILD.sh new file mode 100755 index 0000000..abc5e00 --- /dev/null +++ b/BUILD.sh @@ -0,0 +1,24 @@ +#!/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" + ./README.sh build + echo -e "\nPushing Docker image for $branch" + mvn docker:push + fi + else + echo -e "\nIgnoriere Branch $branch ohne Projekt...\n" + fi +done diff --git a/DIFF.sh b/DIFF.sh new file mode 100755 index 0000000..a2f25cf --- /dev/null +++ b/DIFF.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +source BRANCHES.sh + +for i in $BRANCHES; +do + declare -n branch=${i} + echo -e "\nDiff from $branch against origin/$branch\n" + git diff $branch origin/$branch +done diff --git a/PUSH.sh b/PUSH.sh new file mode 100755 index 0000000..5c2d521 --- /dev/null +++ b/PUSH.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +source BRANCHES.sh + +for i in $BRANCHES; +do + declare -n branch=${i} + echo -e "\nPushing $branch over origin/$branch" + git tag -f ${branch}--BACKUP-ORIGIN--$(date +'%Y-%m-%d--%H-%M-%S') origin/$branch + git tag -f ${branch}--BACKUP-ORIGIN--LAST origin/$branch + git push --force origin $branch:$branch +done diff --git a/REBASE.sh b/REBASE.sh new file mode 100755 index 0000000..1abcb78 --- /dev/null +++ b/REBASE.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +source BRANCHES.sh + +for i in $BRANCHES; +do + declare -n root=${i}__ROOT + declare -n branch=${i} + echo -e "\nRebasing $branch on $root" + git rebase -i $root $branch; +done diff --git a/RESET.sh b/RESET.sh new file mode 100755 index 0000000..e22090a --- /dev/null +++ b/RESET.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +source BRANCHES.sh + +for i in $BRANCHES; +do + declare -n branch=${i} + echo -e "\nResetting $branch to origin/$branch\n\n" + git checkout $branch + git reset --hard origin/$branch; +done -- 2.20.1