-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
update_ops.sh
executable file
·70 lines (61 loc) · 1.2 KB
/
update_ops.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
#!/bin/bash -l
# update userops/teamops/extensions if the default-dirs exist
git pull
set -e
set -o pipefail
CWD=`pwd`
cd cables
cd src/ops/
BASEDIR=`pwd`
OPSDIR=$BASEDIR/users/
branch="master"
if [ -d "$OPSDIR" ]; then
echo "UPDATING USEROPS..."
cd $OPSDIR
if [ -d ".git" ]; then
git checkout $branch
git pull
else
echo " NOT A GIT REPO AT $OPSDIR, SKIPPING";
fi
else
echo " DIR NOT FOUND AT $OPSDIR, SKIPPING";
fi
OPSDIR=$BASEDIR/teams/
branch="main"
if [ -d "$OPSDIR" ]; then
echo "UPDATING TEAMOPS..."
cd $OPSDIR
if [ -d ".git" ]; then
git checkout $branch
git pull
else
echo " NOT A GIT REPO AT $OPSDIR, SKIPPING";
fi
else
echo " DIR NOT FOUND AT $OPSDIR, SKIPPING";
fi
OPSDIR=$BASEDIR/extensions/
branch="main"
if [ -d "$OPSDIR" ]; then
echo "UPDATING EXTENSIONS..."
cd $OPSDIR
if [ -d ".git" ]; then
git checkout $branch
git pull
else
echo " NOT A GIT REPO AT $OPSDIR, SKIPPING";
fi
else
echo " DIR NOT FOUND AT $OPSDIR, SKIPPING";
fi
cd $CWD
if [ -d cables_api ]; then
if [ -f cables_api/package.json ]; then
echo "UPDATING OPDOCS..."
cd $CWD/cables_api
npm run opdocs
fi
fi
cd $CWD
echo "DONE"