WIP: Resolve "bashism; meaningless/incorrect shell detection; no quotes"

Closed Nick Thomas requested to merge nick.thomas/gitlab-ci-multi-runner:1550-fix-bash-shell into master

What does this MR do?

Fix a few issues with the existing bash script generator

Why was this MR needed?

When Docker entrypoints don't quote their arguments, it breaks the bashDetectScript. Further, the detect script is unneeded and confusing (e.g., the use of $@ in the constant which is replaced further down in the code). If "bash" isn't in the path, it can't be guaranteed that "sh" implements the required bashisms, so it's invalid to fall back to it.

A separate MR (!309 (closed)) introduces a POSIX shell script generator and takes the 'sh' name away from BashShell, so I've left it handling shell = "sh" for now.

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • CHANGELOG entry added
  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

Closes #1550 Alternative to !245 !293