]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Helper script for doing release train related project branching and tagging.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Dec 2017 12:41:05 +0000 (14:41 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Dec 2017 12:41:05 +0000 (14:41 +0200)
refs #7396

releng/doc/release-helper.sh [new file with mode: 0755]
releng/doc/release.html
releng/doc/release.md

diff --git a/releng/doc/release-helper.sh b/releng/doc/release-helper.sh
new file mode 100755 (executable)
index 0000000..7f2020e
--- /dev/null
@@ -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} <version> <branch-name> <user-name> clone|branch|checkout|fetch|list-tags|pull|push|push-tags|remove-tag|status|tag"
+
+       ;;
+esac
index ebe85ee67cb86e68d53ae6eba18c0f471923dd1f..cd2aea0df6965c97a955da02316cf66ef6f5d841 100644 (file)
@@ -393,8 +393,8 @@ include &quot;http://www.simantics.org/download/master/org.simantics.sdk.build.t
 location &quot;http://www.simantics.org/download/master/sdk&quot; {\r
 </code></pre>\r
 <p>with</p>\r
 location &quot;http://www.simantics.org/download/master/sdk&quot; {\r
 </code></pre>\r
 <p>with</p>\r
-<pre><code>location &quot;http://www.simantics.org/download/master/release/x.y.z[.w]/maven&quot; {\r
-location &quot;http://www.simantics.org/download/master/release/x.y.z[.w]/manual&quot; {\r
+<pre><code>location &quot;http://www.simantics.org/download/release/x.y.z[.w]/maven&quot; {\r
+location &quot;http://www.simantics.org/download/release/x.y.z[.w]/manual&quot; {\r
 include &quot;http://www.simantics.org/download/release/x.y.z[.w]/org.simantics.sdk.build.targetdefinition.tpd&quot;\r
 location &quot;http://www.simantics.org/download/release/x.y.z[.w]/sdk&quot; {\r
 </code></pre>\r
 include &quot;http://www.simantics.org/download/release/x.y.z[.w]/org.simantics.sdk.build.targetdefinition.tpd&quot;\r
 location &quot;http://www.simantics.org/download/release/x.y.z[.w]/sdk&quot; {\r
 </code></pre>\r
index 3f4d69bfae3222248afa0446d6040239f09286f9..93796ce1436fb66a5691fd377f8187ba1f0d4f84 100644 (file)
@@ -41,7 +41,7 @@ Plug-in components that are part of the release train:
 
 Products that are part of the release train:
 * Simantics Desktop
 
 Products that are part of the release train:
 * Simantics Desktop
-* Simantics System Dynamics Tool \r
+* 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.
   * 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
 
    ~~~
    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" {
    ~~~
    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
 
 
 # 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