Hi Sriram, The script is a python module with Shellcheck linter embedded. I can't wrap that module into a linterscript.sh without breaking up all the modules that are linked to it. If the custom command or the script executor is a shell, shouldn't the task read it just like I call it from a command line? It doesn't and it triggers and error as stated above:
The pipeline fails with return error: 'message': "Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.", 'fix': None} Is there a way to add a shebang which would correct this issue? Thanks for your help. On Tuesday, May 10, 2022 at 1:53:53 AM UTC-4 [email protected] wrote: > On Tue, May 10, 2022 at 1:40 PM Sifu Tian <[email protected]> wrote: > >> >> HI, >> >> Ive tried both. You can see the second screenshot is the custom command >> method. >> > > Ah indeed! > > Both ways don't allow you to save the task if you add #!/bin/sh to the >> argument and throw and error. >> > > Could you replace the #!/bin/bash with the shell script name instead? The > contents of that text box and the arguments are used as parameters for a > Java exec() call. > > So, your custom command would be just myscripts/linterscript.sh (where > linterscript.sh would be committed as executable when committing to git, > and would have #!/bin/bash at the top > > -- Sriram > > >> On Tuesday, May 10, 2022 at 1:00:13 AM UTC-4 [email protected] wrote: >> >>> On Tue, May 10, 2022 at 11:45 AM Sifu Tian <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> I'm sure this is an old issue however I cant seem to find the >>>> resolution. >>>> >>>> I have a script executor with a job that is running a python module >>>> defined for shellcheck linter. >>>> >>> >>> Could you use the Custom Command to run a shell script instead? >>> That way, all your actions would be within a shell script that you can >>> test and store in version control, and then check out and use as a material. >>> >>> https://docs.gocd.org/current/configuration/admin_add_task.html >>> >>> I have not used this task executor plugin since I have always relied on >>> the Custom Command approach above. >>> >>> >>> >>>> >>>> The pipeline fails with return error: >>>> 'message': "Tips depend on target shell and yours is unknown. Add a >>>> shebang or a 'shell' directive.", 'fix': None} >>>> >>>> It's looking for a shell in the script executor which I thought would >>>> be self contained. >>>> While attempted to add #!/bin/sh, it wont allow me to save and >>>> generates the error: >>>> >>>> "There was an unknown error performing the operation. Possible reason >>>> ()" >>>> >>>> If I try with just the customer command option I get this error when >>>> adding #!/bin/sh: >>>> >>>> There was an unknown error performing the operation. Possible reason () >>>> Error when processing params for '#!/bin/sh' used in field >>>> 'argListString', # must be followed by a parameter pattern or escaped by >>>> another #. >>>> >>>> I also found this very old close issue which is a similar issue I'm >>>> having. >>>> https://github.com/gocd/gocd/issues/817 >>>> >>>> Any help would be great. >>>> [image: Screen Shot 2022-05-09 at 11.43.24 PM.png] >>>> [image: Screen Shot 2022-05-09 at 11.42.57 PM.png] >>>> >>>> -- >>>> 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/930eef05-427e-413c-9ccd-ee8494b47d86n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/go-cd/930eef05-427e-413c-9ccd-ee8494b47d86n%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/6378d084-2461-4007-bd42-3c236c284ea1n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/go-cd/6378d084-2461-4007-bd42-3c236c284ea1n%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/ec8c33a5-65d1-4068-832d-8ef71ecbaa3cn%40googlegroups.com.
