Skip to content

Commit c6eec20

Browse files
set proxy global parameter
1 parent c337b76 commit c6eec20

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 10.0.2
1+
version: 10.0.3

start.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ "$USE_SSH" = "true" ]; then
5151
# match "github.com" from ssh uri
5252
REPO=${REPO#"ssh://"}
5353
SSH_HOST=$(echo "$REPO" | cut -d ":" -f 1 | cut -d "@" -f 2)
54-
54+
5555
echo "Adding "$SSH_HOST" to known_hosts"
5656

5757
# removes all keys belonging to hostname from a known_hosts file
@@ -66,6 +66,15 @@ cd $WORKING_DIRECTORY
6666
git config --global advice.detachedhead false
6767
git config --global credential.helper "/bin/sh -c 'echo username=$USERNAME; echo password=$PASSWORD'"
6868

69+
if [ -n "$HTTP_PROXY" ]; then
70+
git config --global http.proxy "$HTTP_PROXY"
71+
else
72+
if [ -n "$HTTPS_PROXY" ]; then
73+
git config --global http.proxy "$HTTPS_PROXY"
74+
fi
75+
fi
76+
77+
6978
if [ -n "$SPARE_CHECKOUT" ]; then
7079
echo "spare checkout"
7180
if [ -d "$CLONE_DIR" ]; then
@@ -76,11 +85,11 @@ if [ -n "$SPARE_CHECKOUT" ]; then
7685
chmod -R 774 $CLONE_DIR
7786
cd $CLONE_DIR
7887
git remote add origin $REPO
79-
git config core.sparsecheckout true
80-
echo "$SOURCE/*" >> .git/info/sparse-checkout
88+
git config core.sparsecheckout true
89+
echo "$SOURCE/*" >> .git/info/sparse-checkout
8190
fi
82-
83-
git pull --depth=1 origin $REVISION
91+
92+
git pull --depth=1 origin $REVISION
8493
exit 0
8594
fi
8695

0 commit comments

Comments
 (0)