Skip to content

Commit

Permalink
Update storage.ts (#11)
Browse files Browse the repository at this point in the history
Upload files by default, if bucket is provided
  • Loading branch information
cybersokari authored Jan 6, 2025
1 parent 2785a44 commit ddf2069
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions apps/cli/src/features/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ export class Storage {
public async uploadArtifacts() {
const foldersToBackup: { path: string, destination?: string }[] = []
const foldersToCount = []
if (this.args.showRetries) {
foldersToBackup.push({path: this.args.RESULTS_PATH})
foldersToCount.push(this.args.RESULTS_PATH)
}
if (this.args.showHistory) {
const historyFolder = `${this.args.REPORTS_DIR}/history`
foldersToBackup.push({path: historyFolder, destination: 'history'})
foldersToCount.push(historyFolder)
}

foldersToBackup.push({path: this.args.RESULTS_PATH})
foldersToCount.push(this.args.RESULTS_PATH)

const historyFolder = `${this.args.REPORTS_DIR}/history`
foldersToBackup.push({path: historyFolder, destination: 'history'})
foldersToCount.push(historyFolder)

const outputFileName = path.join(this.args.ARCHIVE_DIR, Date.now().toString().concat('.zip'))
await zipFolder(foldersToBackup, outputFileName)
const cloudStorageFilePath = path.join(this.args.prefix ?? '', path.basename(outputFileName))
Expand Down

0 comments on commit ddf2069

Please sign in to comment.