Skip to content

Commit 0ed8e5b

Browse files
committed
Passed Azure config to toolkit build env.
1 parent 79a861b commit 0ed8e5b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

toolkit/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ all: toolchain go-tools chroot-tools
201201
# its help will be displayed at the top of the help output.
202202
include $(SCRIPTS_DIR)/help.mk
203203

204+
# Set-up the Azure configuration for the build
205+
include $(SCRIPTS_DIR)/azure_config.mk
206+
204207
# Set up for the timestamp feature
205208
include $(SCRIPTS_DIR)/timestamp.mk
206209

toolkit/scripts/azure_config.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# By default pass original user's Azure configuration if running as root.
5+
# Running as root is required by how the toolkit operates while
6+
# in most cases the user expects to use their Azure configuration, thus the default.
7+
USE_USER_AZURE_CONFIG ?= y
8+
ifneq ($(SUDO_USER),)
9+
ifeq ($(USE_USER_AZURE_CONFIG),y)
10+
# Getting the original user's home directory first.
11+
export AZURE_CONFIG_DIR=$(shell getent passwd "$(SUDO_USER)" | cut -d: -f6)/.azure
12+
endif
13+
endif

0 commit comments

Comments
 (0)