aboutsummaryrefslogtreecommitdiffstats
path: root/releasetag.sh
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-05 16:30:37 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-07 14:46:27 +0200
commit9d7a7dc094f56d04610c2917af37cb9c48e99961 (patch)
treecbb782176309fda193b7c9cd85e2fa574777d969 /releasetag.sh
parent491cc7445644441b11565cb5a52a66ce43cf5f41 (diff)
downloadvendor_replicant-release-scripts-9d7a7dc094f56d04610c2917af37cb9c48e99961.tar.gz
vendor_replicant-release-scripts-9d7a7dc094f56d04610c2917af37cb9c48e99961.tar.bz2
vendor_replicant-release-scripts-9d7a7dc094f56d04610c2917af37cb9c48e99961.zip
Replicant 6.0 0001 images release
Besides updating the scripts to account for changes introduced after Android 4.2, the following modifications were made: * Introduce releasevars.sh to store frequently used variables * Remove SDK parts and devices not yet supported by Replicant 6.0 * Add unpackbootimg to release tools * Use my GPG key for signing * Use more functionality from the repo tool to simplify the scripts * Only accept tags for git metadata. * Additionally tag the LineageOS mirror besides our forked repos. Ignore the manifest repo as it's tagged manually. * Add releasebuild.sh script to build all targets and the toolchain * Make sure a bash shell is used * Use repo tool from $PATH * Abort on error Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'releasetag.sh')
-rwxr-xr-xreleasetag.sh81
1 files changed, 21 insertions, 60 deletions
diff --git a/releasetag.sh b/releasetag.sh
index 21fdad4..90e2c27 100755
--- a/releasetag.sh
+++ b/releasetag.sh
@@ -1,6 +1,7 @@
-#!/bin/sh
+#!/bin/bash
#
# Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+# Copyright (C) 2017 Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
#
# 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
@@ -16,75 +17,41 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+set -e
+
# Variables
SCRIPT=$0
REPLICANT_DIR=$1
-MANIFEST=$2
+
+. releasevars.sh
ARGS_COUNT=1
-COLOR=1
-TMP="/tmp"
-REPO="../tools/repo"
-RELEASE_KEY="4A80EB23"
-REMOTE="replicant"
PUSH_REMOTE="git.replicant.us"
-VERSION="4.2"
-RELEASE="0004"
-
-if [ "$COLOR" = "1" ]
-then
- color_start="\033[36m"
- color_end="\033[0m"
-else
- color_start=""
- color_end=""
-fi
+set_color
-manifest () {
+tag_repos () {
dir=$( pwd )
cd "$REPLICANT_DIR"
- $REPO manifest -r > $MANIFEST
-
- cd "$dir"
-}
-
-tag_repos () {
- list=""
-
- default=$( cat $MANIFEST | grep default | grep "remote=\"$REMOTE\"" )
- if [ "$default" != "" ]
- then
- list=$( cat $MANIFEST | grep project | grep -v "remote=\"" )"\n"
- fi
+ ALL_MIRROR_REPOS=$( repo forall -c ' echo "$REPO_REMOTE$REPO_PROJECT" | grep lineage-mirror \
+ | cut -c15-' )
+ ALL_REPLICANT_REPOS=$( repo forall -c ' echo "$REPO_REMOTE$REPO_PROJECT" | grep replicant \
+ | cut -c10- | grep -v "manifest.git" || true ' )
+ TAGGING_CMD="echo \"Tagging $color_start \$REPO_PROJECT $color_end\" && \
+ git tag -u $RELEASE_KEY -m \"Replicant $VERSION $RELEASE images release\" \
+ \"replicant-$VERSION-$RELEASE\""
+ PUSHING_CMD="echo \"Pushing $color_start \$REPO_PROJECT $color_end\" && \
+ git push \"git@$PUSH_REMOTE:\$REPO_PROJECT\" \"replicant-$VERSION-$RELEASE\""
- list="$list"$( cat $MANIFEST | grep project | grep "remote=\"$REMOTE\"" )
+ repo forall $ALL_MIRROR_REPOS -c "$TAGGING_CMD && $PUSHING_CMD"
+ repo forall $ALL_REPLICANT_REPOS -c "$TAGGING_CMD && $PUSHING_CMD"
- echo "$list" | while read repo
- do
- path=$( echo "$repo" | sed "s/.*path=\"\([^\"]*\)\".*/\1/g" )
- revision=$( echo "$repo" | sed "s/.*revision=\"\([^\"]*\)\".*/\1/g" )
-
- dir=$( pwd )
- cd "$REPLICANT_DIR/$path"
-
- echo "Tagging ""$color_start""$path""$color_end"" with $revision"
-
- git tag -s -u $RELEASE_KEY -m "Replicant $VERSION $RELEASE images release" -a "replicant-$VERSION-$RELEASE" $revision
-
- echo "Pusing ""$color_start""$path""$color_end"
-
- path=$( echo $path | tr '[:upper:]' '[:lower:]' )
-
- git push "git@$PUSH_REMOTE:replicant/$path.git" "replicant-$VERSION-$RELEASE"
-
- cd "$dir"
- done
+ cd "$dir"
}
print_help () {
- echo "$SCRIPT: [REPLICANT_DIR] (MANIFEST)"
+ echo "$SCRIPT: [REPLICANT_DIR]"
}
# Check for the correct number of args
@@ -94,10 +61,4 @@ then
exit 1
fi
-if [ "$MANIFEST" = "" ]
-then
- MANIFEST="$TMP/manifest.xml"
- manifest
-fi
-
tag_repos