forked from graphprotocol/graph-node
-
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.
docker: Include git repo info when running build.sh
- Loading branch information
Showing
1 changed file
with
16 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
#! /bin/bash | ||
|
||
# This file is only here to ease testing/development. The commands in this | ||
# file should ultimately be moved to the corresponding commands for Cloud Build | ||
# in the cloudbuild.*.yaml files | ||
# This file is only here to ease testing/development. Official images are | ||
# built using the 'cloudbuild.yaml' file | ||
|
||
type -p podman > /dev/null && docker=podman || docker=docker | ||
|
||
cd $(dirname $0)/.. | ||
|
||
if [ -d .git ] | ||
then | ||
COMMIT_SHA=$(git rev-parse HEAD) | ||
TAG_NAME=$(git tag --points-at HEAD) | ||
REPO_NAME="Checkout of $(git remote get-url origin) at $(git describe --dirty)" | ||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | ||
fi | ||
for stage in graph-node-build graph-node graph-node-debug | ||
do | ||
$docker build -t $stage --target $stage -f docker/Dockerfile . | ||
$docker build --target $stage \ | ||
--build-arg "COMMIT_SHA=$COMMIT_SHA" \ | ||
--build-arg "REPO_NAME=$REPO_NAME" \ | ||
--build-arg "BRANCH_NAME=$BRANCH_NAME" \ | ||
--build-arg "TAG_NAME=$TAG_NAME" \ | ||
-t $stage \ | ||
-f docker/Dockerfile . | ||
done |