Skip to content

Commit c6a99ad

Browse files
committed
[2.0] Passed Azure config to toolkit build env.
1 parent 23b07c4 commit c6a99ad

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

toolkit/Makefile

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

196+
# Set-up the Azure configuration for the build
197+
include $(SCRIPTS_DIR)/azure_config.mk
198+
196199
# Misc function defines
197200
# Variable prerequisite tracking
198201
include $(SCRIPTS_DIR)/utils.mk

toolkit/scripts/azure_config.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
export AZURE_CONFIG_DIR:=$(shell sudo -u "$(SUDO_USER)" bash -c 'echo $${AZURE_CONFIG_DIR:-$${HOME}/.azure}')
11+
endif
12+
endif

0 commit comments

Comments
 (0)