forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b990be
commit ec76613
Showing
6 changed files
with
71 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
|
||
SRC_DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
BASE_DIR="$SRC_DIR/.." | ||
|
||
# Two arguments specify the remote and branch to use | ||
REMOTE=$1 | ||
BRANCH=$2 | ||
|
||
|
||
echo "Building docker image from branch: $BRANCH at remote: $REMOTE" | ||
|
||
export GOPATH="$SRC_DIR/.build_image_gopath" | ||
WORKPREFIX="$GOPATH/src/github.com/ava-labs" | ||
DOCKER="${DOCKER:-docker}" | ||
keep_existing=0 | ||
while getopts 'k' opt | ||
do | ||
case $opt in | ||
(k) keep_existing=1;; | ||
esac | ||
done | ||
if [[ "$keep_existing" != 1 ]]; then | ||
rm -rf "$WORKPREFIX" | ||
fi | ||
|
||
# Clone the remote and checkout the specified branch to build the Docker image from | ||
GECKO_CLONE="$WORKPREFIX/gecko" | ||
|
||
if [[ ! -d "$WORKPREFIX" ]]; then | ||
mkdir -p "$WORKPREFIX" | ||
git config --global credential.helper cache | ||
git clone "$REMOTE" "$GECKO_CLONE" | ||
git --git-dir="$GECKO_CLONE/.git" checkout "$BRANCH" | ||
fi | ||
|
||
GECKO_COMMIT="$(git --git-dir="$GECKO_CLONE/.git" rev-parse --short HEAD)" | ||
|
||
"${DOCKER}" build -t "gecko-$GECKO_COMMIT" "$GECKO_CLONE" -f "$GECKO_CLONE/Dockerfile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# Build image from current local source | ||
SRC_DIR="$(dirname "${BASH_SOURCE[0]}")" | ||
BASE_DIR="$SRC_DIR/.." | ||
|
||
# WARNING: this will use the most recent commit even if there are un-committed changes present | ||
COMMIT_HASH="$(git --git-dir="$BASE_DIR/.git" rev-parse --short HEAD)" | ||
echo "Building Docker image based off of local repo at commit $COMMIT_HASH" | ||
|
||
docker build -t "gecko-$COMMIT_HASH" "$BASE_DIR" -f "$BASE_DIR/Dockerfile" |