Skip to content

Commit

Permalink
Allow naming of megalinter docker container (#1558)
Browse files Browse the repository at this point in the history
* added support for named docker container

* Update .cspell.json

Co-authored-by: Nicolas Vuillamy <nicolas.vuillamy@gmail.com>
  • Loading branch information
dmitri-trofimov and nvuillam committed Jun 24, 2022
1 parent e939ff3 commit b67e023
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
"conda",
"configfile",
"configfiles",
"containername",
"contextlib",
"contextmanager",
"copypaste",
Expand Down Expand Up @@ -1187,4 +1188,4 @@
"\u0636clojure",
"\u077bcbad"
]
}
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Note: Can be used with `megalinter/megalinter@beta` in your GitHub Action mega-linter.yml file, or with `megalinter/megalinter:beta` docker image

- Support for named Docker container.

- Linter versions upgrades
- [sfdx-scanner-apex](https://forcedotcom.github.io/sfdx-scanner/) from 2.13.4 to **2.13.5** on 2022-06-23
- [sfdx-scanner-aura](https://forcedotcom.github.io/sfdx-scanner/) from 2.13.4 to **2.13.5** on 2022-06-23
Expand Down
1 change: 1 addition & 0 deletions mega-linter-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ The options are only related to mega-linter-runner. For MegaLinter options, plea
| `-h` <br/> `--help` | Show mega-linter-runner help | <!-- --> |
| `-v` <br/> `--version` | Show mega-linter-runner version | <!-- --> |
| `-i` <br/> `--install` | Generate MegaLinter configuration files | <!-- --> |
| `--containername` | Specify MegaLinter container name | <!-- --> |

_You can also use `npx mega-linter-runner` if you do not want to install the package_

Expand Down
5 changes: 5 additions & 0 deletions mega-linter-runner/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ module.exports = optionator({
type: "Boolean",
description: "Upgrade local repository MegaLinter configuration",
},
{
option: "containername",
type: "String",
description: "Specify MegaLinter container name"
}
],
mutuallyExclusive: [
["help", "version", "install"],
Expand Down
3 changes: 3 additions & 0 deletions mega-linter-runner/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ ERROR: Docker engine has not been found on your system.
commandArgs.push(...["-e", envVarEqualsValue]);
}
}
if (commandArgs.containername) {
commandArgs.push(...["--name", commandArgs.containername]);
}
commandArgs.push(dockerImage);

// Call docker run
Expand Down

0 comments on commit b67e023

Please sign in to comment.