From: Tuukka Lehtonen Date: Thu, 7 Dec 2017 12:41:05 +0000 (+0200) Subject: Helper script for doing release train related project branching and tagging. X-Git-Tag: v1.43.0~136^2~666 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=9bc64dd138fad9e364dd69e9c3e1e337cf7e8b32;p=simantics%2Fplatform.git Helper script for doing release train related project branching and tagging. refs #7396 --- diff --git a/releng/doc/release-helper.sh b/releng/doc/release-helper.sh new file mode 100755 index 000000000..7f2020e31 --- /dev/null +++ b/releng/doc/release-helper.sh @@ -0,0 +1,221 @@ +#!/bin/bash + +self=`basename $0` +version=$1 +branch=$2 +user=$3 +action=$4 +tagForVersion=v${version} + +############################################################################### + +declare -a repositories=( + "simantics/third-party.git" "third-party" + "simantics/platform.git" "platform" + "simantics/fmil.git" "fmil" + "simantics/interop.git" "interop" + "simantics/district.git" "district" + "simantics/matlab.git" "matlab" + "simantics/python.git" "python" + "simantics/r.git" "r" + "simantics/sysdyn.git" "sysdyn" + "members/fmi.git" "fmi" + "members/simupedia.git" "simupedia" +) + +repositoryCount=$((${#repositories[@]} / 2)) + +function repo { + eval $1=\${repositories[$(($2 * 2))]} +} + +function localPath { + eval $1=\${repositories[$(($2 * 2 + 1))]} +} + +############################################################################### + +function msg { + echo "[$(($1+1))/${repositoryCount}] $2" +} + +function clone { + echo "git clone ssh://${user}@www.simantics.org:29418/$1" + git clone ssh://${user}@www.simantics.org:29418/$1 +} + +function branch { + echo "git branch $1" + git branch $1 +} + +function fetch { + echo "git fetch --all" + git fetch --all +} + +function pull { + echo "git pull --all" + git pull --all +} + +function pushBranch { + echo "git push origin $1" + git push origin $1 +} + +function checkout { + echo "git checkout $1" + git checkout $1 +} + +function tag { + echo "git tag $1 -m \"Simantics $1 simultaneous release\"" + git tag $1 -m "Simantics $1 simultaneous release" +} + +function removeTag { + echo "git tag -d $1" + git tag -d $1 +} + +function pushTags { + echo "git push origin --tags" + git push origin --tags +} + +function status { + git status +} + +function listTags { + git tag -l +} + +function listBranches { + git branch -a +} + +############################################################################### + +case "$action" in + clone) + mkdir -p $version + pushd $version > /dev/null + for (( i=0; i<${repositoryCount}; i++ )); do + repo p $i + msg $i "Clone $p" + clone $p + done + popd > /dev/null + exit 0 + ;; +esac + +pushd $version > /dev/null +case "$action" in + branch) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Create $branch branch in $lp" + pushd $lp > /dev/null + branch $branch + popd > /dev/null + done + ;; + checkout) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Checkout $branch branch in $lp" + pushd $lp > /dev/null + checkout $branch + popd > /dev/null + done + ;; + tag) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Tag ${version} for $lp" + pushd $lp > /dev/null + checkout $branch + tag ${tagForVersion} + popd > /dev/null + done + ;; + list-branches) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "List branches in $lp" + pushd $lp > /dev/null + listBranches + popd > /dev/null + done + ;; + list-tags) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "List tags in $lp" + pushd $lp > /dev/null + listTags + popd > /dev/null + done + ;; + remove-tag) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Remove tag $tagForVersion from $lp" + pushd $lp > /dev/null + removeTag ${tagForVersion} + popd > /dev/null + done + ;; + fetch) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Fetch from remote origin in $lp" + pushd $lp > /dev/null + fetch + popd > /dev/null + done + ;; + pull) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Pull from remote origin in $lp" + pushd $lp > /dev/null + pull + popd > /dev/null + done + ;; + push) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Push branch $branch to remote origin in $lp" + pushd $lp > /dev/null + pushBranch $branch + popd > /dev/null + done + ;; + push-tags) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Push tags to remote origin in $lp" + pushd $lp > /dev/null + pushTags + popd > /dev/null + done + ;; + status) + for (( i=0; i<${repositoryCount}; i++ )); do + localPath lp $i + msg $i "Status of $lp" + pushd $lp > /dev/null + status + popd > /dev/null + done + ;; + *) + echo "Usage: ${self} clone|branch|checkout|fetch|list-tags|pull|push|push-tags|remove-tag|status|tag" + + ;; +esac diff --git a/releng/doc/release.html b/releng/doc/release.html index ebe85ee67..cd2aea0df 100644 --- a/releng/doc/release.html +++ b/releng/doc/release.html @@ -393,8 +393,8 @@ include "http://www.simantics.org/download/master/org.simantics.sdk.build.t location "http://www.simantics.org/download/master/sdk" {

with

-
location "http://www.simantics.org/download/master/release/x.y.z[.w]/maven" {
-location "http://www.simantics.org/download/master/release/x.y.z[.w]/manual" {
+
location "http://www.simantics.org/download/release/x.y.z[.w]/maven" {
+location "http://www.simantics.org/download/release/x.y.z[.w]/manual" {
 include "http://www.simantics.org/download/release/x.y.z[.w]/org.simantics.sdk.build.targetdefinition.tpd"
 location "http://www.simantics.org/download/release/x.y.z[.w]/sdk" {
 
diff --git a/releng/doc/release.md b/releng/doc/release.md index 3f4d69bfa..93796ce14 100644 --- a/releng/doc/release.md +++ b/releng/doc/release.md @@ -41,7 +41,7 @@ Plug-in components that are part of the release train: Products that are part of the release train: * Simantics Desktop -* Simantics System Dynamics Tool +* Simantics System Dynamics Tool * This is Simantics Desktop with Simantics System Dynamics Tool features installed For simplicity, each of these components are versioned accoring to platform versioning, i.e. for Platform SDK 1.26.0 there will be Simantics Desktop 1.26.0, Sysdyn 1.26.0, and so on. @@ -106,8 +106,8 @@ In the following steps, it is recommended to ensure every `.target` file is up-t with ~~~ - location "http://www.simantics.org/download/master/release/x.y.z[.w]/maven" { - location "http://www.simantics.org/download/master/release/x.y.z[.w]/manual" { + location "http://www.simantics.org/download/release/x.y.z[.w]/maven" { + location "http://www.simantics.org/download/release/x.y.z[.w]/manual" { include "http://www.simantics.org/download/release/x.y.z[.w]/org.simantics.sdk.build.targetdefinition.tpd" location "http://www.simantics.org/download/release/x.y.z[.w]/sdk" { ~~~ @@ -298,4 +298,4 @@ Insert some general thoughts on the release... # TODO -* Incorporate tutorial code in the platform repository as a separate folder to allow platform builds to directly ensure that the tutorial code still builds OK \ No newline at end of file +* Incorporate tutorial code in the platform repository as a separate folder to allow platform builds to directly ensure that the tutorial code still builds OK