File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../.. && pwd )
14
14
source " $AVALANCHE_PATH " /scripts/constants.sh
15
15
16
16
# Build current avalanchego
17
- source " $AVALANCHE_PATH " /scripts/build_image.sh -r
17
+ source " $AVALANCHE_PATH " /scripts/build_image.sh
18
18
19
19
if [[ $current_branch == " master" ]]; then
20
20
echo " Tagging current avalanchego image as $avalanchego_dockerhub_repo :latest"
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ RUN go mod download
16
16
COPY . .
17
17
18
18
# Build avalanchego
19
- RUN ./scripts/build.sh
19
+ ARG RACE_FLAG=""
20
+ RUN ./scripts/build.sh ${RACE_FLAG}
20
21
21
22
# ============= Cleanup Stage ================
22
23
FROM debian:11-slim AS execution
Original file line number Diff line number Diff line change @@ -8,10 +8,19 @@ AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
8
8
# Load the constants
9
9
source " $AVALANCHE_PATH " /scripts/constants.sh
10
10
11
+ if [[ $current_branch == * " -race" ]]; then
12
+ echo " Branch name must not end in '-race'"
13
+ exit 1
14
+ fi
15
+
11
16
# WARNING: this will use the most recent commit even if there are un-committed changes present
12
17
full_commit_hash=" $( git --git-dir=" $AVALANCHE_PATH /.git" rev-parse HEAD) "
13
18
commit_hash=" ${full_commit_hash:: 8} "
14
19
15
20
echo " Building Docker Image with tags: $avalanchego_dockerhub_repo :$commit_hash , $avalanchego_dockerhub_repo :$current_branch "
16
21
docker build -t " $avalanchego_dockerhub_repo :$commit_hash " \
17
22
-t " $avalanchego_dockerhub_repo :$current_branch " " $AVALANCHE_PATH " -f " $AVALANCHE_PATH /Dockerfile"
23
+
24
+ echo " Building Docker Image with tags: $avalanchego_dockerhub_repo :$commit_hash -race , $avalanchego_dockerhub_repo :$current_branch -race"
25
+ docker build --build-arg=" RACE_FLAG=-r" -t " $avalanchego_dockerhub_repo :$commit_hash -race" \
26
+ -t " $avalanchego_dockerhub_repo :$current_branch -race" " $AVALANCHE_PATH " -f " $AVALANCHE_PATH /Dockerfile"
You can’t perform that action at this time.
0 commit comments