Skip to content

Commit

Permalink
Fix bundle-run, use logging env vars (#1048)
Browse files Browse the repository at this point in the history
Technically we only had a problem with bundle run in a custom terminal,
but I'm moving to logging env vars in other places too. For
bundle-deploy it makes the output easier to parse, since logging args
aren't visible.
  • Loading branch information
ilia-db authored Feb 7, 2024
1 parent fc9d3e7 commit 26e03ad
Showing 1 changed file with 8 additions and 31 deletions.
39 changes: 8 additions & 31 deletions packages/databricks-vscode/src/cli/CliWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,14 @@ export class CliWrapper {
) {
const {stdout} = await execFile(
this.cliPath,
[
"bundle",
"validate",
"--target",
target,
...this.getLoggingArguments(),
],
["bundle", "validate", "--target", target],
{
cwd: workspaceFolder.fsPath,
env: {
...EnvVarGenerators.getEnvVarsForCli(configfilePath),
...EnvVarGenerators.getProxyEnvVars(),
...authProvider.toEnv(),
...this.getLogginEnvVars(),
// eslint-disable-next-line @typescript-eslint/naming-convention
DATABRICKS_CLUSTER_ID: this.clusterId,
},
Expand All @@ -276,19 +271,14 @@ export class CliWrapper {
) {
const {stdout, stderr} = await execFile(
this.cliPath,
[
"bundle",
"summary",
"--target",
target,
...this.getLoggingArguments(),
],
["bundle", "summary", "--target", target],
{
cwd: workspaceFolder.fsPath,
env: {
...EnvVarGenerators.getEnvVarsForCli(configfilePath),
...EnvVarGenerators.getProxyEnvVars(),
...authProvider.toEnv(),
...this.getLogginEnvVars(),
// eslint-disable-next-line @typescript-eslint/naming-convention
DATABRICKS_CLUSTER_ID: this.clusterId,
},
Expand Down Expand Up @@ -331,7 +321,6 @@ export class CliWrapper {
outputDirPath,
"--config-file",
initConfigFilePath,
...this.getLoggingArguments(),
],
{env: this.getBundleInitEnvVars(authProvider)}
);
Expand All @@ -345,14 +334,7 @@ export class CliWrapper {
onStdOut?: (data: string) => void,
onStdError?: (data: string) => void
) {
const cmd = [
this.cliPath,
"bundle",
"deploy",
"--target",
target,
...this.getLoggingArguments(),
];
const cmd = [this.cliPath, "bundle", "deploy", "--target", target];
if (onStdError) {
onStdError(`Deploying the bundle for target ${target}...\n`);
if (this.clusterId) {
Expand All @@ -366,6 +348,7 @@ export class CliWrapper {
...EnvVarGenerators.getEnvVarsForCli(configfilePath),
...EnvVarGenerators.getProxyEnvVars(),
...authProvider.toEnv(),
...this.getLogginEnvVars(),
// eslint-disable-next-line @typescript-eslint/naming-convention
DATABRICKS_CLUSTER_ID: this.clusterId,
},
Expand All @@ -390,20 +373,14 @@ export class CliWrapper {
...EnvVarGenerators.getEnvVarsForCli(configfilePath),
...EnvVarGenerators.getProxyEnvVars(),
...authProvider.toEnv(),
...this.getLogginEnvVars(),
// eslint-disable-next-line @typescript-eslint/naming-convention
DATABRICKS_CLUSTER_ID: this.clusterId,
});

return {
cmd: this.cliPath,
args: [
"bundle",
"run",
"--target",
target,
resourceKey,
...this.getLoggingArguments(),
],
args: ["bundle", "run", "--target", target, resourceKey],
options: {
cwd: workspaceFolder.fsPath,
env,
Expand Down

0 comments on commit 26e03ad

Please sign in to comment.