-
Notifications
You must be signed in to change notification settings - Fork 11
/
update_current_tidepool_repos.sh
executable file
·61 lines (54 loc) · 1.24 KB
/
update_current_tidepool_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
#! /bin/sh
# This script depends on a list of current repositories found in tools/current_repos.txt
if [ -f runservers ]; then
cd ..
fi
if [ ! -d tools ]; then
echo "You should be in the tools directory or its immediate parent directory to run this."
exit 1
fi
update_one_tidepool_repo()
{
echo "*** $1 ***"
if [ ! -d "$1" ]; then
echo "Cloning $1 because it seems to be missing."
git clone https://github.com/tidepool-org/$1.git
fi
if [ -d "$1" ]; then
cd $1
git fetch --prune --tags
git pull
if [ -e package.json ]; then
npm install
fi
if [ -e Comedeps ]; then
../tools/come_deps.sh
fi
cd ..
fi
}
update_go()
{
REPO="${1}"
echo "*** ${REPO} ***"
export GOPATH="${PWD}/${REPO}"
pushd "${GOPATH}/src/github.com/tidepool-org/${REPO}"
git fetch --prune --tags
git pull
if [ -f '.env' ]; then
. .env
fi
if [ -f 'Makefile' ]; then
make build
elif [ -f 'build.sh' ]; then
./build.sh
fi
popd
}
for repo in $(cat "tools/required_repos.txt"); do
update_one_tidepool_repo $repo
done
update_go hydrophone
update_go platform
update_go shoreline
update_go tide-whisperer