Kudu: [Linux] zipdeploy + custom deployment call fails: location or permission

Created on 22 Sep 2018  路  5Comments  路  Source: projectkudu/kudu

Requirements/goal : deploy several git repositories (one is pure nodejs website, other are versioned contents (gitbooks)) into one unique linux app service from VSTS/devops.

some rework has to be done in order core app & content can be deployed & live together

  • core app : custom deploy.sh ignoring books folder while kudusync in order content not being deleted if new core version
  • contents : custom deploy.sh for targetting books/bookX rather wwwroot folder

image
_I've tried my best to interact from VSTS/DEVOPS with kudu DEPLOYMENT_TARGET but with no luck, and as I needed to override kudusync call, I went for all custom deploy.sh_

On a fresh linux web app created in on 22nd of september in central US. on all my repository (never worked before)

gitroot.deployment

[config]
command = deploy.sh

gitroot\deploy.sh

[standard one stealed from the linux instance through web SSH & copy paste)

getting following error

/opt/Kudu/bin/Scripts/starter.sh: line 2: exec: deploy.sh: not found
/opt/Kudu/bin/Scripts/starter.sh: line 2: exec: deploy.sh: not foundn/opt/Kudu/bin/Scripts/starter.sh deploy.sh

if I remplace command = deploy.sh by command = ./deploy.sh in .deployment

/opt/Kudu/bin/Scripts/starter.sh: line 2: /tmp/zipdeploy/extracted/deploy.sh: Permission denied
/opt/Kudu/bin/Scripts/starter.sh: line 2: exec: /tmp/zipdeploy/extracted/deploy.sh: cannot execute: Permission denied

any idea what I'm doing wrong ?

Most helpful comment

@bkorbuly @GroofyIT @camous
Hi, I managed to solve the issue by adding bash before the command in .deployment file:

[config]
command = bash scripts/deploy.sh

When using bash to execute a shell script, the .sh file don't have to add +x permission.

I came across some other issues you might want to notice:

  1. use dos2unix to convert the file encoding to unix encoding before it complaining about error syntax
  2. The highest version app service for linux support is actually v10.1.0, not v10.10.0, I found this while debugging the deploy script. However, the portal let you choose v10.10.0, but it's not supported yet in linux container.

All 5 comments

tried many ways to change/keep the execution permission without luck

tried to trick the command neither luck (not an expert in unix ...)
looked at starter.sh and tried to make 2 commands in a row

command = chmod +x /tmp/zipdeploy/extracted/deploy.sh && /tmp/zipdeploy/extracted/deploy.sh

Hi camous,

have you solved this issue?

Same issue here.

@bkorbuly @GroofyIT @camous
Hi, I managed to solve the issue by adding bash before the command in .deployment file:

[config]
command = bash scripts/deploy.sh

When using bash to execute a shell script, the .sh file don't have to add +x permission.

I came across some other issues you might want to notice:

  1. use dos2unix to convert the file encoding to unix encoding before it complaining about error syntax
  2. The highest version app service for linux support is actually v10.1.0, not v10.10.0, I found this while debugging the deploy script. However, the portal let you choose v10.10.0, but it's not supported yet in linux container.

Same issue here, this is still a problem after two years. Every time there's a new subversion of node available in the node versions list, a problem occurs, and every time I have to spent hours trying the good combination to make things work. Can someone point me out an ultimate solution to finally have a configuration that works for more than 1 month ?

Was this page helpful?
0 / 5 - 0 ratings