#!/bin/bash # # Copyright (C) 2015 Paul Kocialkowski # Copyright (C) 2017 Wolfgang Wiedmeyer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # set -e # Variables SCRIPT=$0 REPLICANT_DIR=$1 . releasevars.sh ARGS_COUNT=1 PUSH_REMOTE="git.replicant.us" set_color tag_repos () { dir=$( pwd ) cd "$REPLICANT_DIR" TAG_MESSAGE="Replicant $(echo $RELEASE | sed 's/-/ /') images release" TAGGING_CMD="echo \"Tagging $color_start \$REPO_PROJECT $color_end\" && \ git tag -u $RELEASE_KEY -m \"${TAG_MESSAGE}\" \ \"replicant-$RELEASE\"" PUSHING_CMD="echo \"Pushing $color_start \$REPO_PROJECT $color_end\" && \ git push \"git@$PUSH_REMOTE:\$REPO_PROJECT\" \"replicant-$RELEASE\"" repo forall -c "$TAGGING_CMD && $PUSHING_CMD" repo forall -c "$TAGGING_CMD && $PUSHING_CMD" cd "$dir" } print_help () { echo "$SCRIPT: [REPLICANT_DIR]" } # Check for the correct number of args if [ "$#" -lt "$ARGS_COUNT" ] then print_help exit 1 fi tag_repos