-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-docker-cuda-readme
- Loading branch information
Showing
52 changed files
with
2,922 additions
and
4,728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules/ | ||
runner/ | ||
.terraform/ | ||
.cml/ | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.command = 'asset'; | ||
exports.description = false; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./asset', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.demandCommand() | ||
.strict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
const fs = require('fs').promises; | ||
const kebabcaseKeys = require('kebabcase-keys'); | ||
const winston = require('winston'); | ||
|
||
const { CML } = require('../../../src/cml'); | ||
|
||
exports.command = 'publish <asset>'; | ||
exports.description = 'Publish an asset'; | ||
|
||
exports.handler = async (opts) => { | ||
if (opts.gitlabUploads) { | ||
winston.warn( | ||
'--gitlab-uploads will be deprecated soon, use --native instead' | ||
); | ||
opts.native = true; | ||
} | ||
|
||
const { file, repo, native, asset: path } = opts; | ||
const cml = new CML({ ...opts, repo: native ? repo : 'cml' }); | ||
const output = await cml.publish({ ...opts, path }); | ||
|
||
if (!file) console.log(output); | ||
else await fs.writeFile(file, output); | ||
}; | ||
|
||
exports.builder = (yargs) => yargs.env('CML_ASSET').options(exports.options); | ||
|
||
exports.options = kebabcaseKeys({ | ||
url: { | ||
type: 'string', | ||
description: 'Self-Hosted URL', | ||
hidden: true | ||
}, | ||
md: { | ||
type: 'boolean', | ||
description: 'Output in markdown format [title || name](url)' | ||
}, | ||
title: { | ||
type: 'string', | ||
alias: 't', | ||
description: 'Markdown title [title](url) or ![](url title)' | ||
}, | ||
native: { | ||
type: 'boolean', | ||
description: | ||
"Uses driver's native capabilities to upload assets instead of CML's storage; not available on GitHub" | ||
}, | ||
gitlabUploads: { | ||
type: 'boolean', | ||
hidden: true | ||
}, | ||
rmWatermark: { | ||
type: 'boolean', | ||
description: 'Avoid CML watermark.' | ||
}, | ||
mimeType: { | ||
type: 'string', | ||
defaultDescription: 'infer from the file contents', | ||
description: 'MIME type' | ||
}, | ||
file: { | ||
type: 'string', | ||
alias: 'f', | ||
description: | ||
'Append the output to the given file or create it if does not exist', | ||
hidden: true | ||
}, | ||
repo: { | ||
type: 'string', | ||
description: | ||
'Specifies the repo to be used. If not specified is extracted from the CI ENV.' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.command = 'check'; | ||
exports.description = 'Manage CI checks'; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./check', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.demandCommand() | ||
.strict(); |
Oops, something went wrong.
558fc28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test Comment