This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclone-repos.sh
executable file
·85 lines (72 loc) · 2.55 KB
/
clone-repos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# This script:
# - Clones the Stepup repo's of the gateway, middleware, RA, selfservice and keyserver components for a development
# deploy from github into /src
# - Clones the Stepup-Deploy repo into /deploy
#
# Run this script from the Stepup-VM directory
#
# Will not overwrite existing directories
# Check required tools
REQUIRED_TOOLS=(
"git"
)
for tool in "${REQUIRED_TOOLS[@]}"; do
which ${tool} > /dev/null
if [ $? -ne "0" ]; then
echo "Error: Required command '${tool}' not found in path"
fi
done
# Stop on error
set -e
# Make a src directory for holding the Stepup source repo's
# Note: If you want the sources to reside somewhere else, you can make "src" a symlink.
# E.g.: ln -s ~/mysources src
if [ ! -e "./src" ]; then
echo "Creating src directory"
mkdir "src"
else
echo "Directory ./src exists. Not creating that directory."
fi
# List of repositories (Format: <Github origanization>:<name>)
SOURCE_REPOS=(
"OpenConext:Stepup-Gateway"
"OpenConext:Stepup-Middleware"
"OpenConext:Stepup-SelfService"
"OpenConext:Stepup-RA"
"OpenConext:Stepup-tiqr"
"SURFnet:oath-service-php"
"OpenConext:Stepup-Webauthn"
"OpenConext:Stepup-Azure-MFA"
)
# Clone sources from github, if directory does not yet exist
for repo in "${SOURCE_REPOS[@]}"; do
org=${repo%%:*}
name=${repo#*:}
if [ ! -e "./src/${name}" ]; then
echo "git clone https://github.com/${org}/${name}.git ./src/${name}"
git clone https://github.com/${org}/${name}.git ./src/${name}
else
echo "Directory ./src/${name} exists. Skipping git clone into that directory."
fi
done
# Checkout the deploy repository as "deploy"
# Note: If you want the deploy repository to reside somewhere else, you can make "deploy" a symlink.
# E.g.: ln -s ~/mydeployrepo deploy
if [ ! -e "./deploy" ]; then
echo "git clone https://github.com/OpenConext/Stepup-Deploy.git ./deploy"
git clone https://github.com/OpenConext/Stepup-Deploy.git ./deploy
else
echo "Directory ./deploy exists. Skipping git clone into that directory."
fi
if [ ! -e "./src/stepup-demo-gssp" ]; then
git clone https://github.com/OpenConext/Stepup-gssp-example.git ./src/stepup-demo-gssp
else
echo "Directory ./src/Stepup-gssp-example exists. Skipping git clone into that directory."
fi
if [ ! -e "./src/stepup-demo-gssp-2" ]; then
git clone https://github.com/OpenConext/Stepup-gssp-example.git ./src/stepup-demo-gssp-2
else
echo "Directory ./src/Stepup-gssp-example-2 exists. Skipping git clone into that directory."
fi
echo "OK."