Skip to content

Commit

Permalink
Fix pull-all script and output for gitpod prebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
Carbrex committed Jul 21, 2024
1 parent 8b9b195 commit 536f740
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lila-docker
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ fast_setup() {
for i in {1..100}; do # 100 * 5 = 500 seconds
sleep 5
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/)
echo "Status code: $status_code"
echo "Waited for $((i * 5)) seconds"
if [ "$status_code" -ne 502 ]; then
echo "lila is ready after $((i * 5)) seconds"
break
fi
echo "Checking if lila is ready... not yet (Status code: $status_code after $((i * 5)) seconds) "
done
fi
}
Expand Down
18 changes: 16 additions & 2 deletions pull-all
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -e
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")"
initial_dir=$(pwd)
Expand Down Expand Up @@ -41,7 +43,19 @@ for dir in ./repos/*; do
continue
fi

git fetch upstream "$main_or_master" 2>/dev/null
# check if repo has an upstream or origin remote
upstream_or_origin=""
if [[ $(git remote -v | grep upstream) ]]; then
upstream_or_origin="upstream"
elif [[ $(git remote -v | grep origin) ]]; then
upstream_or_origin="origin"
else
echo "$dir : doesn't have an upstream or origin remote."
cd "$initial_dir"
continue
fi

git fetch "$upstream_or_origin" "$main_or_master" 2>/dev/null

# if repo is not on main or master branch, don't do anything
if [[ $(git branch --show-current) != "$main_or_master" ]]; then
Expand Down

0 comments on commit 536f740

Please sign in to comment.