Skip to content

Commit 70ea6a1

Browse files
Merge pull request #5012 from wilzbach/circleci-use-more-fallbacks
[CircleCi]: use more fallbacks in case of a failure
2 parents f6e18bf + 86818c5 commit 70ea6a1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

circleci.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ install_deps() {
2121
fi
2222

2323
for i in {0..4}; do
24-
if curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://dlang.org/install.sh -O; then
24+
if curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://dlang.org/install.sh -O ||
25+
curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://nightlies.dlang.org/install.sh -O ; then
2526
break
2627
elif [ $i -ge 4 ]; then
2728
sleep $((1 << $i))
@@ -56,12 +57,13 @@ clone() {
5657
setup_repos()
5758
{
5859
# set a default in case we run into rate limit restrictions
59-
local base_branch="master"
60+
local base_branch=""
6061
if [ -n "${CIRCLE_PR_NUMBER:-}" ]; then
61-
base_branch=$(curl -fsSL https://api.github.com/repos/dlang/phobos/pulls/$CIRCLE_PR_NUMBER | jq -r '.base.ref')
62+
base_branch=$((curl -fsSL https://api.github.com/repos/dlang/phobos/pulls/$CIRCLE_PR_NUMBER || echo) | jq -r '.base.ref')
6263
else
6364
base_branch=$CIRCLE_BRANCH
6465
fi
66+
base_branch=${base_branch:-"master"}
6567
6668
# merge upstream branch with changes, s.t. we check with the latest changes
6769
if [ -n "${CIRCLE_PR_NUMBER:-}" ]; then

0 commit comments

Comments
 (0)