Skip to content

Commit

Permalink
Merge pull request #53 from useblacksmith/change-env-process
Browse files Browse the repository at this point in the history
src: change arch to use BLACKSMITH_ENV
  • Loading branch information
adityamaru authored Nov 30, 2024
2 parents b7eb016 + 4938a7e commit 99d48d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function reportBuildFailed(dockerBuildId: string | null, dockerBuildDurati
async function postWithRetryToBlacksmithAPI(url: string, requestBody: unknown, retryCondition: (error: AxiosError) => boolean): Promise<AxiosResponse> {
const maxRetries = 5;
const retryDelay = 100;
const apiUrl = process.env.PETNAME?.includes('staging') ? 'https://stagingapi.blacksmith.sh' : 'https://api.blacksmith.sh';
const apiUrl = process.env.BLACKSMITH_ENV?.includes('staging') ? 'https://stagingapi.blacksmith.sh' : 'https://api.blacksmith.sh';

for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
Expand Down Expand Up @@ -380,7 +380,7 @@ async function reportBuild(dockerfilePath: string) {
dockerfile_path: dockerfilePath,
repo_name: process.env.GITHUB_REPO_NAME || '',
region: process.env.BLACKSMITH_REGION || 'eu-central',
arch: process.env.PETNAME?.includes('arm') ? 'arm64' : 'amd64',
arch: process.env.BLACKSMITH_ENV?.includes('arm') ? 'arm64' : 'amd64',
git_sha: process.env.GITHUB_SHA || '',
vm_id: process.env.VM_ID || '',
git_branch: process.env.GITHUB_REF_NAME || ''
Expand All @@ -405,7 +405,7 @@ async function reportBuilderCreationFailed(stickydiskKey: string) {
stickydisk_key: stickydiskKey,
repo_name: process.env.GITHUB_REPO_NAME || '',
region: process.env.BLACKSMITH_REGION || 'eu-central',
arch: process.env.PETNAME?.includes('arm') ? 'arm64' : 'amd64',
arch: process.env.BLACKSMITH_ENV?.includes('arm') ? 'arm64' : 'amd64',
vm_id: process.env.VM_ID || '',
petname: process.env.PETNAME || ''
};
Expand Down

0 comments on commit 99d48d0

Please sign in to comment.