Skip to content

Commit

Permalink
[build]: allow to customize USERNAME and PASSWORD in command line (#492)
Browse files Browse the repository at this point in the history
* [build]: allow to customize USERNAME and PASSWORD in command line

* use default password and username if not specified in the command line
  • Loading branch information
lguohan authored Apr 12, 2017
1 parent 5585221 commit 2e9b92e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ DOCKER_BUILD = docker build --no-cache \
PLATFORM=$(PLATFORM) \
BUILD_NUMBER=$(BUILD_NUMBER) \
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME) \
$@

sonic-slave-build :
Expand Down
8 changes: 4 additions & 4 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ SONIC_CONFIG_LOG_TO_FILES = y
# Comment next line to disable:
# SONIC_CONFIG_ENABLE_COLORS = y

# USERNAME - username for installer build
USERNAME = admin
# DEFAULT_USERNAME - default username for installer build
DEFAULT_USERNAME = admin

# PASSWORD - password for installer build
PASSWORD = YourPaSsWoRd
# DEFAULT_PASSWORD - default password for installer build
DEFAULT_PASSWORD = YourPaSsWoRd

# ENABLE_DHCP_GRAPH_SERVICE - specify the source of minigraph to generate configuration file.
# If set to y SONiC will get the minigraph from graph service. Graph service URL need to be
Expand Down
8 changes: 8 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ ifneq ($(CONFIGURED_PLATFORM), undefined)
include $(PLATFORM_PATH)/rules.mk
endif

ifeq ($(USERNAME),)
override USERNAME := $(DEFAULT_USERNAME)
endif

ifeq ($(PASSWORD),)
override PASSWORD := $(DEFAULT_PASSWORD)
endif

MAKEFLAGS += -j $(SONIC_CONFIG_BUILD_JOBS)

###############################################################################
Expand Down

0 comments on commit 2e9b92e

Please # to comment.