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

Error on deploy builds: unterminated quoted string #2720

Closed
danepowell opened this issue Apr 6, 2018 · 1 comment
Closed

Error on deploy builds: unterminated quoted string #2720

danepowell opened this issue Apr 6, 2018 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@danepowell
Copy link
Contributor

My system information:

  • BLT version: 9.0.5

It looks like the deployment identifier can have quotes in it that aren't escaped properly before writing to disk. I got this error recently on a Pipelines build:

[ExecStack] Running echo 'MMv[Nwm'' > deployment_identifier in /tmp/artifact
sh: 1: Syntax error: Unterminated quoted string```
@grasmash grasmash added the Bug Something isn't working label Apr 10, 2018
@malikkotob
Copy link
Contributor

malikkotob commented Apr 11, 2018

My first thought was that we could surround the string with double quotes instead of single, e.g. "MMv[Nwm'". That's obviously not going to work because double quotes could be returned, lol. So our options are:
a) Find double, single quotes, and backslashes and escape them (would need to be careful not to escape backslashes being used as escape characters)
b) Prevent double and single quotes from being part of the deployment_identifier.
c) Some combination

For option b, one thing to be aware of is that the tag name is used as the deployment identifier if what is being deployed is a tag. Since BLT probably shouldn't limit tag name selection, we would still need to escape double and single quotes, as well as backslashes. So it seems like I just talked myself into option a.

@danepowell, @grasmash, @mikemadison13 what're your thoughts here?

EDIT: This may all be unnecessary. Going to try refactoring the current approach to instead use Robo's taskWriteToFile, which is the same approach we use to generate the hash salt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants