summaryrefslogtreecommitdiffstats
path: root/build/setup/repos.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@ipecompute2.ands.kit.edu>2020-03-09 03:37:34 +0100
committerSuren A. Chilingaryan <csa@ipecompute2.ands.kit.edu>2020-03-09 03:37:34 +0100
commit8fb3c0a3f96024786305a1234fe5cfb70e6f00c0 (patch)
treedc313b424aab723f8a9b17865cdcf0904eb501d0 /build/setup/repos.sh
downloadccpi-8fb3c0a3f96024786305a1234fe5cfb70e6f00c0.tar.gz
ccpi-8fb3c0a3f96024786305a1234fe5cfb70e6f00c0.tar.bz2
ccpi-8fb3c0a3f96024786305a1234fe5cfb70e6f00c0.tar.xz
ccpi-8fb3c0a3f96024786305a1234fe5cfb70e6f00c0.zip
Initial release
Diffstat (limited to 'build/setup/repos.sh')
-rw-r--r--build/setup/repos.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/build/setup/repos.sh b/build/setup/repos.sh
new file mode 100644
index 0000000..9e76208
--- /dev/null
+++ b/build/setup/repos.sh
@@ -0,0 +1,41 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+setup_path="$1"
+repos_path="$2"
+[ -z "$setup_path" ] && setup_path="/root/setup"
+[ -z "$repos_path" ] && repos_path="/ccpi/repos"
+
+repos=( \
+ "https://github.com/astra-toolbox/astra-toolbox.git tags/v1.8.3 astra.sh" \
+ "https://github.com/vais-ral/CCPi-Framework.git master ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-FrameworkPlugins.git master ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-astra.git update_projectors ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git master ccpi.sh" \
+)
+
+function install_repo {
+ repo="$1"
+ name=$(basename "$repo" .git)
+ branch="$2"
+ script="$3"
+
+ [ -d "$name" ] || git clone "$repo"
+
+ (
+ cd "$name"
+ git pull origin "$branch"
+ git checkout "$branch"
+ bash "$setup_path/build/$script"
+ ln -sf "$setup_path/build/$script" ands_install.sh
+ )
+}
+
+mkdir -p "$repos_path"
+(
+ cd "$repos_path"
+ for repo in "${repos[@]}"; do
+ install_repo $repo
+ done
+)