-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·88 lines (76 loc) · 2.18 KB
/
setup.sh
File metadata and controls
executable file
·88 lines (76 loc) · 2.18 KB
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
86
87
88
#!/bin/bash
############################################################
# Help #
############################################################
show_help()
{
echo "Setup netobserv upstream/downstream repositories for syncing"
echo
echo "Syntax: setup.sh [-h|-y]"
echo "Options:"
echo " -h Print this help."
echo " -y Yes-mode (non-interactive: proceed without asking)."
echo
echo "Example:"
echo " ./setup.sh -y"
echo
}
# Reset in case getopts has been used previously in the shell.
OPTIND=1
yes_mode=0
while getopts "h?y" opt; do
case "$opt" in
h|\?)
show_help
exit 0
;;
y)
yes_mode=1
;;
esac
done
shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift
if [ "$#" != "0" ]; then
echo "Too many arguments: $@"
show_help
exit 1
fi
echo "Cloning and setting up repositories in current directory."
if [[ $yes_mode != 1 ]]; then
read -p "Continue? [yN] " yn
echo
if [[ ! $yn =~ ^[Yy]$ ]] ; then
exit 1
fi
fi
git clone -o upstream git@github.com:netobserv/network-observability-operator.git operator
pushd operator
git remote add downstream git@github.com:openshift/network-observability-operator.git
git fetch upstream
git fetch downstream
popd
git clone -o upstream git@github.com:netobserv/netobserv-ebpf-agent.git ebpf-agent
pushd ebpf-agent
git remote add downstream git@github.com:openshift/network-observability-ebpf-agent.git
git fetch upstream
git fetch downstream
popd
git clone -o upstream git@github.com:netobserv/flowlogs-pipeline.git flowlogs-pipeline
pushd flowlogs-pipeline
git remote add downstream git@github.com:openshift/network-observability-flowlogs-pipeline.git
git fetch upstream
git fetch downstream
popd
git clone -o upstream git@github.com:netobserv/netobserv-web-console.git console-plugin
pushd console-plugin
git remote add downstream git@github.com:openshift/network-observability-console-plugin.git
git fetch upstream
git fetch downstream
popd
git clone -o upstream git@github.com:netobserv/netobserv-cli.git cli
pushd cli
git remote add downstream git@github.com:openshift/network-observability-cli.git
git fetch upstream
git fetch downstream
popd