]> git.parisson.com Git - mezzo.git/commitdiff
[Docker] : add hook for build on docker hub
authorEmilie Zawadzki <emilie.zawadzki@ircam.fr>
Tue, 13 Nov 2018 14:29:51 +0000 (15:29 +0100)
committerEmilie Zawadzki <emilie.zawadzki@ircam.fr>
Tue, 13 Nov 2018 14:29:59 +0000 (15:29 +0100)
hooks/post_checkout [new file with mode: 0644]

diff --git a/hooks/post_checkout b/hooks/post_checkout
new file mode 100644 (file)
index 0000000..18dafc1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+curr_branch=$(git symbolic-ref --short HEAD)
+
+echo $curr_branch
+if [ $curr_branch != "master" ] && [ $curr_branch != "dev" ];
+then
+    curr_branch="dev"
+fi
+
+# checkout new submodule
+git submodule update --init
+# Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules
+git submodule sync
+# Checkout all submodules on right branches specified in .gitmodules, by default the branch is master
+git submodule foreach --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch-'$curr_branch' || echo master)'
+# Pull all submodules on right branches specified in .gitmodules, by default the branch is master
+git submodule foreach --recursive 'git pull origin $(git config -f $toplevel/.gitmodules submodule.$name.branch-'$curr_branch' || echo master)'