[make] Introducing build option SOURCE_FOLDER (#1155)
When KEEP_SLAVE_ON=yes and SOURCE_FOLDER is defined, the path pointed by SOURCE_FOLDER will be mounted in the build slave docker at /var/src. This option allows user to mount an extra path into the build slave when the slave is left running. Usually when user need to build extra stuff in SOURCE_FOLDER.
This commit is contained in:
parent
a99b5e9e29
commit
d3765066fe
7
Makefile
7
Makefile
@ -12,6 +12,7 @@
|
|||||||
# * USERNAME: Desired username -- default at rules/config
|
# * USERNAME: Desired username -- default at rules/config
|
||||||
# * PASSWORD: Desired password -- default at rules/config
|
# * PASSWORD: Desired password -- default at rules/config
|
||||||
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
|
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
|
||||||
|
# * SOURCE_FOLDER: host path to be mount as /var/src, only effective when KEEP_SLAVE_ON=yes
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
@ -72,7 +73,11 @@ SONIC_BUILD_INSTRUCTION := make \
|
|||||||
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
|
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
|
||||||
$(DOCKER_BUILD) ; }
|
$(DOCKER_BUILD) ; }
|
||||||
ifeq "$(KEEP_SLAVE_ON)" "yes"
|
ifeq "$(KEEP_SLAVE_ON)" "yes"
|
||||||
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
|
ifdef SOURCE_FOLDER
|
||||||
|
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
|
||||||
|
else
|
||||||
|
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) $(SONIC_BUILD_INSTRUCTION) $@
|
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) $(SONIC_BUILD_INSTRUCTION) $@
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user