Hi Chad,

Thanks,

I found the issue.  For some reason, even though I installed salt-ssh under 
the go user, I put in the pipeline script 
echo $USER
id $(echo $USER)
and it showed that the pipeline was running under the ubuntu user...which 
absolutely did not make any sense.
So I proceeded to do the install of salt-ssh again through the pipeline 
itself.

echo $USER
id $(echo $USER)
pip install salt-ssh==3002.6
export PATH=/var/go/.local/bin:$PATH
salt-ssh -V

After I received a successful pipeline for the commands above, I removed 
everthing and put my original salt-ssh command and it completed 
successfully.
I can't explain why it was running as ubuntu but it works now.
On Saturday, December 4, 2021 at 1:11:18 AM UTC-5 Chad Wilson wrote:

> Hiya
>
> When you run Bash from tools like GoCD it runs non-interactive, non-login 
> shells so my understanding is that no files such as .bashrc are 
> automatically loaded.
>
> If you want to tell a task to load this automatically you could set 
> BASH_ENV=/home/go/.bashrc (or to any other such init file) in the GoCD 
> environment variables for any pipeline/stage/job. If you really want it to 
> apply across all commands on the agent you could set BASH_ENV in the GoCD 
> agent environment too and it would propagate to all tasks that agent runs.
>
> -Chad
>
> On Sat, Dec 4, 2021 at 11:44 AM Sifu Tian <[email protected]> wrote:
>
>> Hi Everyone,
>>
>> Ive been spinning my wheels trying to get my pipeline to run a straight 
>> forward salt-ssh command place in the script editor.
>>
>> I've updated my .bashrc with the path export PATH=$PATH:/var/go/.local/bin
>> as this is where salt-ssh is installed however I still get an error 
>> */f835531d-e481-4e73-8770-bfb4950256fa.sh: line 2: salt-ssh: command not 
>> found*
>> *[script-executor] Script completed with exit code: 127.*
>>
>> When I run the command from the agent under the go user, it runs just 
>> fine:
>> -------------- Succeeded: 102 (changed=8) Failed: 0 -------------- Total 
>> states run: 102 Total run time: 9.241 s 
>>
>> Im not sure what Im doing wrong but any help would be greatly appreciated
>>
>> -- 
>>
> 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/9dabb32c-d43f-4acf-b892-116486832dbbn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/go-cd/9dabb32c-d43f-4acf-b892-116486832dbbn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/d99e0454-3050-4b99-9737-09cffa0da78dn%40googlegroups.com.

Reply via email to