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

Custom deployment Script kudu for Linux Azure web app Django #112

Open
arislanIOT opened this issue Nov 5, 2019 · 5 comments
Open

Custom deployment Script kudu for Linux Azure web app Django #112

arislanIOT opened this issue Nov 5, 2019 · 5 comments

Comments

@arislanIOT
Copy link

As I'm aware default kudu build in Linux Azure web app last command is

$ python manage.py collectstatic.

I'm trying to add the command
$python manage.py migrate #This is a necessary command in kudu build.

I generated .deployment and deploy.cmd file using the kuduscript.

Issue.:
when I push the repo, the deployment in azure web app fails and give the following error

Command: deploy.cmd /opt/Kudu/Scripts/starter.sh: line 2: exec: deploy.cmd: not found /opt/Kudu/Scripts/starter.sh: line 2: exec: deploy.cmd: not found\n/opt/Kudu/Scripts/starter.sh deploy.cmd

Please assist to resolve this issue and guide me on this.

@arislanIOT
Copy link
Author

@davidfowl @davidebbo

@ahmelsayed
Copy link
Member

for kuduscript can you try --scriptType bash abd use deploy.sh instead.

Though I thought Kudu linux uses oryx not kuduscript, right @sanchitmehta?

@sanchitmehta
Copy link

@ahmelsayed yes we do use Oryx Builds for python apps.

@arislanIOT Are you using a post deployment script/custom deployment script to deploy the app ?

@arislanIOT
Copy link
Author

@ahmelsayed Yes, kudu is using Oryx build for python apps.

@sanchitmehta

The above error comes when we use custom deployment, since I'm using linux web app for Django.

The task I'm trying to achieve here is two things.

  1. When we push a code (Django) to Linux Web app, the default Oryx build runs up to
    $ python manage.py colllectstatic.

What should I do if I need to run python manage.py migrate.

  1. I need to use a complete custom deployment script, which I know we can mention it in the repo in a file .deployment like
    [config]
    command = deploy.sh

the issue is that there is no deployment script available for deploy.sh, I found deploy.cmd also I generated one using the

$ kuduscript --deployment --python

command but this are not working and giving above error when using deploy.cmd generated using the kuduscript. Please note we cannot create bash script like this.

@Bill7zz
Copy link

Bill7zz commented Mar 3, 2020

kudu will not work because Linux will not execute the .deployment file since it is a dotfile.

If you need to make a custom deployment you cand use the Oryx configuration in the App Setting of the web app.

I deployed a web app using the Git Deployemt process. Then I updated the Deployment ARM template of the web app to have the variable POST_BUILD_COMMAND in the App Setting which will have the path to the script file to execute.

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

No branches or pull requests

4 participants