-
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.
chore: update build scripts & makefile
- Loading branch information
1 parent
2b84044
commit aabccdb
Showing
6 changed files
with
81 additions
and
33 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 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 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,33 @@ | ||
# ============================================================================== | ||
# Makefile helper functions for docker image | ||
# | ||
|
||
DOCKER := docker | ||
|
||
# Docker version | ||
TAG := $(VERSION:v%=%) | ||
|
||
# Image build related variables. | ||
REGISTRY_PREFIX ?= bingo | ||
|
||
# Determine image files by looking into cmd/* | ||
IMAGES_DIR ?= $(wildcard ${ROOT_DIR}/cmd/*) | ||
# Determine images names by stripping out the dir names | ||
IMAGES ?= $(filter-out tools,$(foreach image,${IMAGES_DIR},$(notdir ${image}))) | ||
|
||
ifeq (${IMAGES},) | ||
$(error Could not determine IMAGES, set ONEX_ROOT or run in source dir) | ||
endif | ||
|
||
.PHONY: image.build | ||
image.build: | ||
$(ROOT_DIR)/scripts/docker/build.sh -a amd64 | ||
|
||
.PHONY: image.push | ||
image.push: $(addprefix image.push., $(IMAGES)) | ||
|
||
.PHONY: image.push.% | ||
image.push.%: image.build.% ## Build and push specified docker image. | ||
$(eval IMAGE := $*) | ||
@echo "===========> Pushing image $(IMAGE) $(TAG) to $(REGISTRY_PREFIX)" | ||
$(DOCKER) push $(REGISTRY_PREFIX)/$(IMAGE):$(TAG) |