Reputation: 127
Travis CI's user documentation has a section on how to escape secure environment variables. It seems not to work for the a single space. Is there anything special that needs done for the space character?
I tried to encrypt my sql server connection string like this
travis encrypt AzureSqlServerPath="Server=<server>\;Initial\ Catalog=<database>\;Persist\ Security\ Info=False\;User\ ID=<user>\;Password=<password>\;MultipleActiveResultSets=False\;Encrypt=True\;TrustServerCertificate=False\;Connection\ Timeout=30\;" --add --com
The variable is set fine but the spaces do not translate correctly to the environment variable. It truncates the string at the first space that is encountered.
Server=<server>;Initial
Upvotes: 1
Views: 348
Reputation: 127
I finally got something to work through trial and error. It seems that the solution was to use quotes within quotes and escape the inner quotes. Then I did not have to escape any other special character within the connection string.
travis encrypt AzureSqlServerPath="\"Server=<server>;Initial Catalog=<database>;Persist Security Info=False;User ID=<user>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;\"" --add --com
Upvotes: 2