Skip to content

Commit 59bb107

Browse files
committed
Updating: adding operators branch env variable
1 parent a458d0b commit 59bb107

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ popd
1212

1313
pushd server
1414
npm install
15-
./scripts/update-operators.sh $COMMUNITY_REPO || exit 1
15+
./scripts/update-operators.sh $COMMUNITY_REPO $COMMUNITY_BRANCH || exit 1
1616
popd

server/scripts/update-operators.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
#!/bin/sh
22

3-
if [ ! -d "data/community-operators" ]; then
4-
pushd ./data/
3+
pushd ./data/
54

5+
if [ ! -d "community-operators" ]; then
6+
67
if [ ! $1 ]; then
78
echo "Using default community operators repository"
89
OPERATORS_REPO=https://github.com/operator-framework/community-operators.git
910
else
1011
OPERATORS_REPO=$1
12+
echo "Using $OPERATORS_REPO as community operators repository"
1113
fi
1214

1315
git clone $OPERATORS_REPO community-operators || exit 1
14-
popd
16+
fi
1517

16-
exit 0
18+
if [ ! $2 ]; then
19+
echo "Using master branch"
20+
OPERATORS_BRANCH=master
21+
else
22+
OPERATORS_BRANCH=$2
23+
echo "Using $OPERATORS_BRANCH branch"
1724
fi
1825

19-
pushd data/community-operators
20-
git fetch origin master
21-
git pull origin master
26+
pushd community-operators
27+
git fetch origin $OPERATORS_BRANCH
28+
git pull origin $OPERATORS_BRANCH
2229
popd
2330

31+
popd
2432
exit 0

0 commit comments

Comments
 (0)