Webhook: unable to locate command oO

Created on 5 Jan 2018  路  5Comments  路  Source: adnanh/webhook

Greetings
The sh file/command exists in the folder/volume. But even doing several tests returns me "unable to locate command"

like:

RUN mkdir -p /var/scripts
WORKDIR /var/scripts

COPY ["redeploy.sh", "gateway.json", "/var/scripts/"]
RUN chmod +x /var/scripts

gateway.json  redeploy.sh
/var/scripts # cat gateway.json
[
  {
    "id": "redeploy-webhook",
    "execute-command": "/var/scripts/redeploy.sh",
    "command-working-directory": "/usr/local/bin/webhook"
  }
]

/var/scripts # cat /var/scripts/redeploy.sh
#!/bin/bash
echo "Script Iniciado"
cd /rancherCLI/rancher-v0.6.7
export RANCHER_URL=http://192.168.99.199:8080
export RANCHER_ACCESS_KEY=$ACkEY
export RANCHER_SECRET_KEY=$SECRETK
export RANCHER_ENVIRONMENT=$ENV
export RANCHER_CLIENT_DEBUG=true
echo "rancherCLI pronto"
./rancher -v
./rancher restart G-Tools/rancher-gaucho
05/01/2018 02:11:25[webhook] 2018/01/05 05:11:25 [e203bc] incoming HTTP request from 192.168.99.1:51841
05/01/2018 02:11:25[webhook] 2018/01/05 05:11:25 [e203bc] redeploy-webhook got matched
05/01/2018 02:11:25[webhook] 2018/01/05 05:11:25 [e203bc] redeploy-webhook hook triggered successfully
05/01/2018 02:11:25[webhook] 2018/01/05 05:11:25 200 | 170.475碌s | 192.168.99.100:9000 | GET /hooks/redeploy-webhook
05/01/2018 02:11:25[webhook] 2018/01/05 05:11:25 unable to locate command: '/var/scripts/redeploy.sh'

Cheers

question

Most helpful comment

Try changing RUN chmod +x /var/scripts
into RUN chmod +x /var/scripts/redeploy.sh

All 5 comments

Try changing RUN chmod +x /var/scripts
into RUN chmod +x /var/scripts/redeploy.sh

Seems working but got this

05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] incoming HTTP request from 192.168.99.1:50902
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] redeploy-webhook got matched
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] redeploy-webhook hook triggered successfully
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 200 | 154.473碌s | 192.168.99.100:9000 | GET /hooks/redeploy-webhook
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] executing /var/scripts/redeploy.sh (/var/scripts/redeploy.sh) with arguments ["/var/scripts/redeploy.sh"] and environment [] using /var/scripts as cwd
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] command output:
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] error occurred: fork/exec /var/scripts/redeploy.sh: no such file or directory
05/01/2018 10:45:58[webhook] 2018/01/05 13:45:58 [b98734] finished handling redeploy-webhook

I was using #!/bin/bash instead of #!/bin/sh in my script.

Awesome! Happy hacking :-)

I thank you for the tool! I've never used Webhook. And now I can see how it makes life so much easier xD

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamaze picture adamaze  路  5Comments

nkv16786 picture nkv16786  路  3Comments

macau23 picture macau23  路  6Comments

Gareth-3aaa picture Gareth-3aaa  路  4Comments

wranitzky picture wranitzky  路  6Comments