Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support commands with arguments #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oker1
Copy link

@oker1 oker1 commented Jan 9, 2015

No description provided.

@soupdiver
Copy link
Owner

Arguments would simply be provided like?

"commands": [
        "/home/bar/deploy.sh -t",
        "/home/bar/cleanup.sh --speed -t --retry-once"
      ]

@oker1
Copy link
Author

oker1 commented Jan 9, 2015

It's not working that way because exec.Command's first parameter is the executable, the rest are the parameters. You'll get an error that it can't be executed.

@soupdiver
Copy link
Owner

Ok, so can you give an example how to provide the arguments?

@kakawait
Copy link

Using @oker1 fork following command works

gitlab-webhook     | 2016/03/22 10:47:12 Executed: /usr/bin/git --git-dir=/repos/my_repo/.git pull origin master

whereas using @soupdiver master I have following error

gitlab-webhook     | 2016/03/22 10:45:32 fork/exec /usr/bin/git --git-dir=/repos/my_repo/.git pull origin master: no such file or directory

kakawait added a commit to kakawait/docker-gitlab-webhook that referenced this pull request Mar 22, 2016
@soupdiver
Copy link
Owner

@kakawait @oker1 I'm willing to merge the PR but please also update https://github.com/soupdiver/go-gitlab-webhook/blob/master/config.example.json so that there is an example on how to provide the arguments properly.

@oker1
Copy link
Author

oker1 commented Mar 23, 2016

You don't have to change the config, the command is split up at spaces.

@kakawait
Copy link

Yes config.json from my previous sample is strictly the same!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants