Skip to content
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

Bitbucket driver choice #822

Merged
merged 4 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion bin/cml/pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports.builder = (yargs) =>
},
driver: {
type: 'string',
choices: ['github', 'gitlab'],
choices: ['github', 'gitlab', 'bitbucket'],
description: 'If not specify it infers it from the ENV.'
}
})
Expand Down
36 changes: 18 additions & 18 deletions bin/cml/pr.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ describe('CML e2e', () => {
const output = await exec(`echo none | node ./bin/cml.js pr --help`);

expect(output).toMatchInlineSnapshot(`
"cml.js pr <glob path...>
"cml.js pr <glob path...>

Create a pull request with the specified files
Create a pull request with the specified files

Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--md Output in markdown format [](url). [boolean]
--remote Sets git remote. [string] [default: \\"origin\\"]
--user-email Sets git user email. [string] [default: \\"[email protected]\\"]
--user-name Sets git user name. [string] [default: \\"Olivaw[bot]\\"]
--repo Specifies the repo to be used. If not specified is extracted
from the CI ENV. [string]
--token Personal access token to be used. If not specified in extracted
from ENV REPO_TOKEN. [string]
--driver If not specify it infers it from the ENV.
[string] [choices: \\"github\\", \\"gitlab\\"]"
`);
Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--md Output in markdown format [](url). [boolean]
--remote Sets git remote. [string] [default: \\"origin\\"]
--user-email Sets git user email. [string] [default: \\"[email protected]\\"]
--user-name Sets git user name. [string] [default: \\"Olivaw[bot]\\"]
--repo Specifies the repo to be used. If not specified is extracted
from the CI ENV. [string]
--token Personal access token to be used. If not specified in extracted
from ENV REPO_TOKEN. [string]
--driver If not specify it infers it from the ENV.
[string] [choices: \\"github\\", \\"gitlab\\", \\"bitbucket\\"]"
`);
});
});
2 changes: 1 addition & 1 deletion bin/cml/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ exports.builder = (yargs) =>
},
driver: {
type: 'string',
choices: ['github', 'gitlab'],
choices: ['github', 'gitlab', 'bitbucket'],
description: 'If not specify it infers it from the ENV.'
}
})
Expand Down
62 changes: 31 additions & 31 deletions bin/cml/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ describe('CML e2e', () => {
const output = await exec(`node ./bin/cml.js publish --help`);

expect(output).toMatchInlineSnapshot(`
"cml.js publish <asset>

Upload an image to build a report

Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--md Output in markdown format [title ||
name](url). [boolean]
-t, --title Markdown title [title](url) or ![](url title).
[string]
--native, --gitlab-uploads Uses driver's native capabilities to upload
assets instead of CML's storage. Currently
only available for GitLab CI. [boolean]
--rm-watermark Avoid CML watermark. [boolean]
--mime-type Specifies the mime-type. If not set guess it
from the content. [string]
-f, --file Append the output to the given file. Create it
if does not exist. [string]
--repo Specifies the repo to be used. If not
specified is extracted from the CI ENV.
[string]
--token Personal access token to be used. If not
specified, extracted from ENV REPO_TOKEN,
GITLAB_TOKEN, GITHUB_TOKEN, or
BITBUCKET_TOKEN. [string]
--driver If not specify it infers it from the ENV.
[string] [choices: \\"github\\", \\"gitlab\\"]"
`);
"cml.js publish <asset>

Upload an image to build a report

Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--md Output in markdown format [title ||
name](url). [boolean]
-t, --title Markdown title [title](url) or ![](url title).
[string]
--native, --gitlab-uploads Uses driver's native capabilities to upload
assets instead of CML's storage. Currently
only available for GitLab CI. [boolean]
--rm-watermark Avoid CML watermark. [boolean]
--mime-type Specifies the mime-type. If not set guess it
from the content. [string]
-f, --file Append the output to the given file. Create it
if does not exist. [string]
--repo Specifies the repo to be used. If not
specified is extracted from the CI ENV.
[string]
--token Personal access token to be used. If not
specified, extracted from ENV REPO_TOKEN,
GITLAB_TOKEN, GITHUB_TOKEN, or
BITBUCKET_TOKEN. [string]
--driver If not specify it infers it from the ENV.
[string] [choices: \\"github\\", \\"gitlab\\", \\"bitbucket\\"]"
`);
});

test('cml publish assets/logo.png --md', async () => {
Expand Down
2 changes: 1 addition & 1 deletion bin/cml/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ exports.builder = (yargs) =>
},
driver: {
type: 'string',
choices: ['github', 'gitlab'],
choices: ['github', 'gitlab', 'bitbucket'],
DavidGOrtega marked this conversation as resolved.
Show resolved Hide resolved
description:
'Platform where the repository is hosted. If not specified, it will be inferred from the environment'
},
Expand Down
111 changes: 56 additions & 55 deletions bin/cml/runner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,63 @@ describe('CML e2e', () => {
const output = await exec(`echo none | node ./bin/cml.js runner --help`);

expect(output).toMatchInlineSnapshot(`
"cml.js runner
"cml.js runner

Launch and register a self-hosted runner
Launch and register a self-hosted runner

Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--labels One or more user-defined labels for this runner
(delimited with commas) [string] [default: \\"cml\\"]
--idle-timeout Seconds to wait for jobs before shutting down. Set
to -1 to disable timeout [number] [default: 300]
--name Name displayed in the repository once registered
[string] [default: cml-{ID}]
--no-retry Do not restart workflow terminated due to instance
disposal or GitHub Actions timeout [boolean]
--single Exit after running a single job [boolean]
--reuse Don't launch a new runner if an existing one has
the same name or overlapping labels [boolean]
--driver Platform where the repository is hosted. If not
specified, it will be inferred from the
environment [string] [choices: \\"github\\", \\"gitlab\\"]
--repo Repository to be used for registering the runner.
If not specified, it will be inferred from the
environment [string]
--token Personal access token to register a self-hosted
runner on the repository. If not specified, it
will be inferred from the environment [string]
--cloud Cloud to deploy the runner
[string] [choices: \\"aws\\", \\"azure\\", \\"gcp\\", \\"kubernetes\\"]
--cloud-region Region where the instance is deployed. Choices:
[us-east, us-west, eu-west, eu-north]. Also
accepts native cloud regions
[string] [default: \\"us-west\\"]
--cloud-type Instance type. Choices: [m, l, xl]. Also supports
native types like i.e. t2.micro [string]
--cloud-permission-set Specifies the instance profile in AWS or instance
service account in GCP [string] [default: \\"\\"]
--cloud-metadata Key Value pairs to associate cml-runner instance
on the provider i.e. tags/labels \\"key=value\\"
[array] [default: []]
--cloud-gpu GPU type.
[string] [choices: \\"nogpu\\", \\"k80\\", \\"v100\\", \\"tesla\\"]
--cloud-hdd-size HDD size in GB [number]
--cloud-ssh-private Custom private RSA SSH key. If not provided an
automatically generated throwaway key will be used
[string]
--cloud-spot Request a spot instance [boolean]
--cloud-spot-price Maximum spot instance bidding price in USD.
Defaults to the current spot bidding price
[number] [default: -1]
--cloud-startup-script Run the provided Base64-encoded Linux shell script
during the instance initialization [string]
--cloud-aws-security-group Specifies the security group in AWS
[string] [default: \\"\\"]"
`);
Options:
--help Show help [boolean]
--version Show version number [boolean]
--log Maximum log level
[string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
--labels One or more user-defined labels for this runner
(delimited with commas) [string] [default: \\"cml\\"]
--idle-timeout Seconds to wait for jobs before shutting down. Set
to -1 to disable timeout [number] [default: 300]
--name Name displayed in the repository once registered
[string] [default: cml-{ID}]
--no-retry Do not restart workflow terminated due to instance
disposal or GitHub Actions timeout [boolean]
--single Exit after running a single job [boolean]
--reuse Don't launch a new runner if an existing one has
the same name or overlapping labels [boolean]
--driver Platform where the repository is hosted. If not
specified, it will be inferred from the
environment
[string] [choices: \\"github\\", \\"gitlab\\", \\"bitbucket\\"]
--repo Repository to be used for registering the runner.
If not specified, it will be inferred from the
environment [string]
--token Personal access token to register a self-hosted
runner on the repository. If not specified, it
will be inferred from the environment [string]
--cloud Cloud to deploy the runner
[string] [choices: \\"aws\\", \\"azure\\", \\"gcp\\", \\"kubernetes\\"]
--cloud-region Region where the instance is deployed. Choices:
[us-east, us-west, eu-west, eu-north]. Also
accepts native cloud regions
[string] [default: \\"us-west\\"]
--cloud-type Instance type. Choices: [m, l, xl]. Also supports
native types like i.e. t2.micro [string]
--cloud-permission-set Specifies the instance profile in AWS or instance
service account in GCP [string] [default: \\"\\"]
--cloud-metadata Key Value pairs to associate cml-runner instance
on the provider i.e. tags/labels \\"key=value\\"
[array] [default: []]
--cloud-gpu GPU type.
[string] [choices: \\"nogpu\\", \\"k80\\", \\"v100\\", \\"tesla\\"]
--cloud-hdd-size HDD size in GB [number]
--cloud-ssh-private Custom private RSA SSH key. If not provided an
automatically generated throwaway key will be used
[string]
--cloud-spot Request a spot instance [boolean]
--cloud-spot-price Maximum spot instance bidding price in USD.
Defaults to the current spot bidding price
[number] [default: -1]
--cloud-startup-script Run the provided Base64-encoded Linux shell script
during the instance initialization [string]
--cloud-aws-security-group Specifies the security group in AWS
[string] [default: \\"\\"]"
`);
});
});