这是indexloc提供的服务,不要输入任何密码
Skip to content

Allow CICD to use DEBUG output #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ddn-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,27 @@ jobs:
--override-description "$description" \
--rebuild-connectors \
--override \
--log-level FATAL \
--quiet \
--no-interaction > build_output.json
--log-level DEBUG \
--json-output $RUNNER_TEMP/axiom.json \
--no-interaction
else
echo "Skipping connector build."
./scripts/deploy/deploy.mjs \
--context telco-dev \
--profile telco \
--override-description "$description" \
--override \
--log-level FATAL \
--quiet \
--no-interaction > build_output.json
--log-level DEBUG \
--json-output $RUNNER_TEMP/axiom.json \
--no-interaction
fi

- name: Extract URLs from JSON
if: env.no_op != 'true'
run: |
cat build_output.json
BUILD_URLS=$(jq -r '.build_url' build_output.json | tr '\n' ',')
CONSOLE_URLS=$(jq -r '.console_url' build_output.json | tr '\n' ',')
cat $RUNNER_TEMP/axiom.json
BUILD_URLS=$(jq -r '.build_url' $RUNNER_TEMP/axiom.json | tr '\n' ',')
CONSOLE_URLS=$(jq -r '.console_url' $RUNNER_TEMP/axiom.json | tr '\n' ',')
echo "build_urls=${BUILD_URLS%,}" >> $GITHUB_ENV
echo "console_urls=${CONSOLE_URLS%,}" >> $GITHUB_ENV

Expand Down
8 changes: 8 additions & 0 deletions scripts/deploy/deploy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DeploymentManager {
.option('-x, --override-description <desc>', 'Override description')
.option('-q, --quiet', 'Quiet mode')
.option('-a, --apply-build', 'Auto-apply build', false)
.option('-j, --json-output <file>', 'Output build info to JSON file')
.parse(process.argv);

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -85,6 +86,13 @@ class DeploymentManager {
const output = await this.execCommand(cmd, context);
const buildInfo = JSON.parse(output);
this.options.quiet && console.log(output);
if (this.options.jsonOutput) {
try {
fs.writeFileSync(this.options.jsonOutput, output);
} catch (err) {
console.error(`Failed to write to JSON output file: ${err.message}`);
}
}
return buildInfo;
}
}
Expand Down