Skip to content

Commit

Permalink
MegaLinter server (#1106)
Browse files Browse the repository at this point in the history
* PHP version switch (#1083)

* fixe issue #1060

* fix hadolint error DL3059

* [automation] Auto-update linters version, help and documentation (#1088)

* [automation] Auto-update linters version, help and documentation

* Increase trivy timeout

* [automation] Auto-update linters version, help and documentation (#1091)

* Release MegaLinter v5.3.0

* [automation] Auto-update linters version, help and documentation (#1097)

* Fix CHANGELOG

* [automation] Auto-update linters version, help and documentation (#1098)

* [automation] Auto-update linters version, help and documentation (#1100)

* [automation] Auto-update linters version, help and documentation (#1101)

* [automation] Auto-update linters version, help and documentation (#1104)

* KEEP_ALIVE_MEGALINTER v0

* openssh

* Build standalone linters only for linters managing SARIF

* Entrypoint

* Entrypoint: exit when test cases called

* Add openrc

* Try another way

https://github.com/danielguerra69/alpine-sshd

* Startup lines at the end

* Test simple case with password

* rhaaaa

* Remove ssh stuff as we loose env variables

* Server v0

* Server v0

* Add workspace argument

* Expose on port 80

* Manage running processes

* try debug flask

* debug mode for server

* v0 ?

* Fix server for report file name

* SARIF in http response

* [automation] Auto-update linters version, help and documentation (#1107)

* [automation] Auto-update linters version, help and documentation (#1109)

* [automation] Auto-update linters version, help and documentation (#1113)

* Bring back ssh

* Set env variables for all users

* [automation] Auto-update linters version, help and documentation (#1114)

* [automation] Auto-update linters version, help and documentation (#1116)

* [automation] Auto-update linters version, help and documentation (#1117)

* new SSH way with tmux

* Build

* Allow PWD auth for testing

* [automation] Auto-update linters version, help and documentation (#1118)

* [automation] Auto-update linters version, help and documentation (#1121)

* Release MegaLinter v5.4.0

* [automation] Auto-update linters version, help and documentation (#1122)

* [automation] Auto-update linters version, help and documentation (#1123)

* [automation] Auto-update linters version, help and documentation (#1124)

* [automation] Auto-update linters version, help and documentation (#1129)

* [clj-kondo] update docs and version to 2021.12.19 (#1126)

Co-authored-by: nvuillam <[email protected]>

* fix "MegaLinter vs Super-Linter" link in README (#1130)

Co-authored-by: Nicolas Vuillamy <[email protected]>

* Move ssh management to entrypoint

* QuickFix

* try again

* Stop docker container if entrypoint fails

* Sh in container

* alias for megalinger when running in server mode (#1133)

makes running megalinter in server mode easier

* aliases

* Build

* tmux_exec

* Build !

* [automation] Auto-update linters version, help and documentation (#1131)

* gha

* motd

* build

* -input and -output v0

* Use argparse

* Use parse_known_args

* config.set

* [automation] Auto-update linters version, help and documentation (#1135)

* DOCKER_DEFAULT_WORKSPACE_DIR & absolue path for --input argument

* introduce shell script to convenience running from ssh (#1137)

* Create megalinter_tmux

* Update build.py

* Build

Co-authored-by: nvuillam <[email protected]>

* Use --input

* Fix --input + CI

* CI for Inbar (create branch named v6_inbar )

* [automation] Auto-update linters version, help and documentation (#1138)

* [automation] Auto-update linters version, help and documentation (#1141)

* [automation] Auto-update linters version, help and documentation (#1142)

* Release MegaLinter v5.5.0

* V6 inbar (#1143)

* capture std is optional

capture std is optional

* improve megalinter_tmux script

add verbosity as an optional flag, improve some messages, add comments, fix script name in examples

* Bash file as executable

* Fix shellcheck issue https://github.com/koalaman/shellcheck/wiki/SC2124

* Python & Dockerfiles lint errors

* cspell

* Build

* Ignore tmux_exec for bash controlling

* pylint err

* cspell

Co-authored-by: Laurent Laville <[email protected]>
Co-authored-by: John Practicalli <[email protected]>
Co-authored-by: Adam Ralph <[email protected]>
Co-authored-by: Inbar <[email protected]>
  • Loading branch information
5 people authored Jan 4, 2022
1 parent f0173d5 commit 5929dad
Show file tree
Hide file tree
Showing 185 changed files with 2,912 additions and 1,270 deletions.
30 changes: 27 additions & 3 deletions .automation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,14 @@ def generate_flavor(flavor, flavor_info):
with open(flavor_action_yml, "w", encoding="utf-8") as file:
file.write(action_yml)
logging.info(f"Updated {flavor_action_yml}")
build_dockerfile(dockerfile, descriptor_and_linters, requires_docker, flavor, [])
extra_lines = [
"COPY entrypoint.sh /entrypoint.sh",
"RUN chmod +x entrypoint.sh",
'ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]',
]
build_dockerfile(
dockerfile, descriptor_and_linters, requires_docker, flavor, extra_lines
)


def build_dockerfile(
Expand Down Expand Up @@ -380,6 +387,9 @@ def generate_linter_dockerfiles():
)
# Browse descriptor linters
for linter in descriptor_linters:
# Do not build standalone linter if it does not manage SARIF
if linter.can_output_sarif is False:
continue
# Unique linter dockerfile
linter_lower_name = linter.name.lower()
dockerfile = f"{LINTERS_DIR}/{linter_lower_name}/Dockerfile"
Expand All @@ -404,6 +414,20 @@ def generate_linter_dockerfiles():
" EMAIL_REPORTER=false \\",
" FILEIO_REPORTER=false \\",
" CONFIG_REPORTER=false",
"",
# "EXPOSE 80",
"RUN mkdir /root/docker_ssh && mkdir /usr/bin/megalinter-sh",
"EXPOSE 22",
"COPY entrypoint.sh /entrypoint.sh",
"COPY sh /usr/bin/megalinter-sh",
"COPY sh/megalinter_tmux /usr/bin/megalinter_tmux",
"COPY sh/motd /etc/motd",
'RUN find /usr/bin/megalinter-sh/ -type f -iname "*.sh" -exec chmod +x {} \\; && \\',
" chmod +x entrypoint.sh && \\",
" chmod +x /usr/bin/megalinter_tmux && \\",
" echo \"alias megalinter='python -m megalinter.run'\" >> ~/.bashrc && source ~/.bashrc && \\",
" echo \"alias tmux_exec='/usr/bin/megalinter-sh/tmux_exec.sh'\" >> ~/.bashrc && source ~/.bashrc",
'ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]',
]
build_dockerfile(
dockerfile, descriptor_and_linter, requires_docker, "none", extra_lines
Expand Down Expand Up @@ -1707,7 +1731,7 @@ def replace_in_file(file_path, start, end, content, add_new_line=True):
# Write the file out again
with open(file_path, "w", encoding="utf-8") as file:
file.write(file_content)
logging.info("Updated " + file.name)
logging.info("Updated " + file.name + " between " + start + " and " + end)


def add_in_config_schema_file(variables):
Expand Down Expand Up @@ -1778,7 +1802,7 @@ def move_to_file(file_path, start, end, target_file, keep_in_source=False):
# Write the file out again
with open(file_path, "w", encoding="utf-8") as file:
file.write(file_content)
logging.info("Updated " + file.name)
logging.info("Updated " + file.name + " between " + start + " and " + end)
bracket_content = (
bracket_content.replace("####", "#THREE#")
.replace("###", "#TWO#")
Expand Down
Loading

0 comments on commit 5929dad

Please sign in to comment.