It is definitely only an issue if the pipeline calls the Shell script
directly. There is no issue if a secondary script is used. Also, another
point of information, I'm configuring my pipelines in code as JSON.
On Friday, January 3, 2020 at 11:37:11 AM UTC-5, Chris Flynn wrote:
>
> I have a task that calls a Shell script. The Shell script is connecting to
> a remote server with SSH. The SSH command makes use of environment
> variables set on the pipeline.
>
> from the Shell script...
> echo "Stop Tomcat server on ${HOST}..."
> ssh ${SSH_OPTS} ${SSH_USER}@${HOST} "sudo /sbin/service tomcat-${ENV} stop"
>
> This task fails and when when I look at the logs I see that single quotes
> have been added around the *${SSH_OPTS}* and where the code has double
> quotes.
> ssh '-o StrictHostKeyChecking=no -i ~/.ssh/my.pem' [email protected]
> 'sudo /sbin/service tomcat-dev stop'
>
> You can see that it does not add single quotes around *my-user* or
> *myhost.com
> <http://myhost.com>* variables. I've done other testing to confirm that
> it appears that single quotes are only added to environment variables that
> contain spaces.
>
> HOWEVER...
>
> I've also noticed that when this Shell script calls another Shell script
> the *${SSH_OPTS}* value does not have single quotes added to it. So the
> behavior does not seem to be consistent...
> ssh -o StrictHostKeyChecking=no -i ~/.ssh/my.pem [email protected] 'ln
> -s ~/properties/my-dev.properties ~/properties/my.properties'
>
> Both of the shell scripts run on the same server.
>
> I've tried running the log output on the same sever and having two sets of
> single quotes in the command causes a problem.
>
>
> Does anyone have any suggestions to help resolve this issue? Thank you for
> your help.
>
--
You received this message because you are subscribed to the Google Groups
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/go-cd/d2ed8d62-7110-485a-831f-0100d97359e5%40googlegroups.com.