Thanks Marques, that solved the problem! Really appreciate your help in all of this.
Also thanks Ram and Fenn for your input :) So next time I get a permission error, make sure to ensure that if im running a bash script that calls another bash script, to put /bin/sh in front of it. On Mon, Feb 22, 2021 at 3:01 PM Marques Lee <[email protected]> wrote: > Gah! Sorry I might be confusing you more than helping. I misread what you > last pasted (confused which script was being executed in the task). > > Keep the task config as what you had before: > > Command: /bin/sh > Args: > ./gocd/game-deploy/pushGames.sh > > Then on line 13 of pushGames.sh, invoke pushOneGame.sh like this: > > /bin/sh ./gocd/game-deploy/pushOneGame.sh > > You should not get the same permission denied error. > > On Sun, Feb 21, 2021 at 5:55 PM Marques Lee <[email protected]> > wrote: > >> I believe it was line 13 of pushGames.sh. That’s where you should invoke >> the script with /bin/sh or /bin/bash explicitly. >> >> On Sun, Feb 21, 2021 at 5:54 PM Marques Lee <[email protected]> >> wrote: >> >>> I was referring to putting that within your script, not as a separate >>> task. >>> >>> I’ve also noticed you use /bin/sh (maybe your agent doesn’t have bash?). >>> >>> You are on a Windows machine, right? Not sure how ntfs maps Linux file >>> permissions, if at all. It could very well be the case that everything on >>> your file system is considered 0777. However, I’m assuming the GoCD agent >>> is running on Linux, which does need the permissions. So what you see >>> locally probably does not reflect what the agent sees. >>> >>> At any rate, I would make that script call part of your patent script >>> that you showed us earlier (ie, the script with the curl calls) and not a >>> separate task. It should get you farther. >>> >>> On Sun, Feb 21, 2021 at 5:43 PM Gabriel Callaghan < >>> [email protected]> wrote: >>> >>>> I had a look at the permissions of the files used, and I get: >>>> -rwxrwxrwx 1 jabes jabes 470 Feb 22 12:09 pushGames.sh >>>> -rwxrwxrwx 1 jabes jabes 751 Feb 22 12:09 pushOneGame.sh >>>> >>>> which should mean it all works? >>>> >>>> I am currently looking into how to give the go account a way to run >>>> these. >>>> >>>> Marques, I did what you said and now I get this: >>>> [go] Task: /bin/bash ./gocd/game-deploy/pushGames.shtook: 0.3s >>>> Error happened while attempting to execute '/bin/bash >>>> ./gocd/game-deploy/pushGames.sh'. >>>> Please make sure [/bin/bash ./gocd/game-deploy/pushGames.sh] can be >>>> executed on this agent. >>>> [Debug Information] Environment variable PATH: >>>> /home/go:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin >>>> >>>> Does this mean all my files have permissions set so I don't need to use >>>> chmod, but I need to poke around in the settings of GOCD more? I'm guessing >>>> this agent needs to be edited more? is the go user mentioned by Ram the >>>> same as the agent? >>>> >>>> >>>> On Mon, Feb 22, 2021 at 1:30 PM Marques Lee < >>>> [email protected]> wrote: >>>> >>>>> You should be able to commit an executable permissions change in git. >>>>> >>>>> But you could also side step all of these by running your script >>>>> explicitly with the shell. That will make your script robust and not rely >>>>> on exec permissions. >>>>> >>>>> What I mean is do: >>>>> >>>>> /bin/bash ./gocd/game-deploy/pushOneGame.sh >>>>> >>>>> Inside of your script. It will always run and doesn’t depend on exec >>>>> bit being set. >>>>> >>>>> On Sun, Feb 21, 2021 at 4:26 PM Fenn <[email protected]> wrote: >>>>> >>>>>> This might help: >>>>>> >>>>>> >>>>>> https://linoxide.com/linux-shell-script/make-bash-script-executable-using-chmod/ >>>>>> >>>>>> If not try these: >>>>>> >>>>>> https://linuxize.com/post/chmod-command-in-linux/ >>>>>> https://www.lifewire.com/uses-of-command-chmod-2201064 >>>>>> https://linux.die.net/man/1/chmod >>>>>> https://linux.die.net/man/1/chown >>>>>> https://linux.die.net/man/8/groupadd >>>>>> https://linux.die.net/man/8/usermod >>>>>> https://linux.die.net/man/5/group >>>>>> >>>>>> -- >>>>>> 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/CAGJwi9iE4DH4zV4mciG%3DVhPuF117iikitHvwbZAUE%2B7xbC-2bA%40mail.gmail.com >>>>>> . >>>>>> >>>>> -- >>>>> 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/CAPKX9jZmhUQCaciGaD%3DB486CWsWM4Z-VvgNbCmOj-eEedhifNw%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/go-cd/CAPKX9jZmhUQCaciGaD%3DB486CWsWM4Z-VvgNbCmOj-eEedhifNw%40mail.gmail.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/CAKV4bkd4e2LMzr9Fab%3DLcWhp0hfVPQj%2Bzj%2BwLH-%2BdNWe4sOiTw%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/go-cd/CAKV4bkd4e2LMzr9Fab%3DLcWhp0hfVPQj%2Bzj%2BwLH-%2BdNWe4sOiTw%40mail.gmail.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/CAPKX9ja0KhGf6_Vp2sxRJ%2BYFMcwYD1cAv0SpMmu38skxv%2BNGOQ%40mail.gmail.com > <https://groups.google.com/d/msgid/go-cd/CAPKX9ja0KhGf6_Vp2sxRJ%2BYFMcwYD1cAv0SpMmu38skxv%2BNGOQ%40mail.gmail.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/CAKV4bkfyDbOAPqUEo%2BTWajXe6pWV%2Bouca-Czq2Tixq%2BgH%3D1GyQ%40mail.gmail.com.
