Skip to content

Commit

Permalink
Mount AZURE_CONFIG_DIR folder instead of ~/.azure (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia authored Jan 16, 2025
1 parent ce5a2f6 commit 48a3fb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ export async function main() {
inlineScript = ` set -e >&2; echo '${START_SCRIPT_EXECUTION_MARKER}' >&2; ${inlineScript}`;
scriptFileName = await createScriptFile(inlineScript);

const hostAzureConfigDir = process.env.AZURE_CONFIG_DIR || path.join(process.env.HOME, '.azure');
const containerAzureConfigDir = '/root/.azure';

/*
For the docker run command, we are doing the following
- Set the working directory for docker continer
- volume mount the GITHUB_WORKSPACE env variable (path where users checkout code is present) to work directory of container
- voulme mount .azure session token file between host and container,
- volume mount Azure config directory between host and container,
- volume mount temp directory between host and container, inline script file is created in temp directory
*/
let args: string[] = ["run", "--workdir", `${process.env.GITHUB_WORKSPACE}`,
"-v", `${process.env.GITHUB_WORKSPACE}:${process.env.GITHUB_WORKSPACE}`,
"-v", `${process.env.HOME}/.azure:/root/.azure`,
"-v", `${hostAzureConfigDir}:${containerAzureConfigDir}`,
"-v", `${TEMP_DIRECTORY}:${TEMP_DIRECTORY}`
];
for (let key in process.env) {
Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export const checkIfEnvironmentVariableIsOmitted = (key: string): boolean => {
'JOURNAL_STREAM',
'DEPLOYMENT_BASEPATH',
'VCPKG_INSTALLATION_ROOT',
'PERFLOG_LOCATION_SETTING'
'PERFLOG_LOCATION_SETTING',
'AZURE_CONFIG_DIR'
];

const omitEnvironmentVariablesWithPrefix: string [] = [
Expand Down

0 comments on commit 48a3fb0

Please sign in to comment.