Azure Web应用程序间歇地将代码从TMP复制到家中
我正在通过GitHub操作将DJANGO应用程序部署到Azure Web应用程序。该代码始终部署到TMP文件夹,但并不总是复制到wwwroot,即使ORYX部署日志表明复制了内容。是什么导致这种间歇性行为?
Detecting platforms...
Detected following platforms:
python: 3.8.12
Using intermediate directory '/tmp/8da59cae1f18fde'.
Copying files to the intermediate directory...
Done in 0 sec(s).
Source directory : /tmp/8da59cae1f18fde
Destination directory: /home/site/wwwroot
Python Version: /opt/python/3.8.12/bin/python3.8
Creating directory for command manifest file if it doesnot exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
Content in source directory is a Django app
Running collectstatic...
Done in 18 sec(s).
Not a vso image, so not writing build commands
Preparing output...
Copying files to destination directory '/tmp/_preCompressedDestinationDir'...
Done in 31 sec(s).
Compressing content of directory '/tmp/_preCompressedDestinationDir'...
Copied the compressed output to '/home/site/wwwroot'
Removing existing manifest file
Creating a manifest file...
Manifest file created.
Done in 244 sec(s).
I am deploying a Django appication to a Azure Web App via Github Actions. The code is consistently deployed to the tmp folder but is not always copied to wwwroot, even though Oryx deployment logs state that the contents are copied. What causes this intermittent behaviour?
Detecting platforms...
Detected following platforms:
python: 3.8.12
Using intermediate directory '/tmp/8da59cae1f18fde'.
Copying files to the intermediate directory...
Done in 0 sec(s).
Source directory : /tmp/8da59cae1f18fde
Destination directory: /home/site/wwwroot
Python Version: /opt/python/3.8.12/bin/python3.8
Creating directory for command manifest file if it doesnot exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
Content in source directory is a Django app
Running collectstatic...
Done in 18 sec(s).
Not a vso image, so not writing build commands
Preparing output...
Copying files to destination directory '/tmp/_preCompressedDestinationDir'...
Done in 31 sec(s).
Compressing content of directory '/tmp/_preCompressedDestinationDir'...
Copied the compressed output to '/home/site/wwwroot'
Removing existing manifest file
Creating a manifest file...
Manifest file created.
Done in 244 sec(s).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于可能在同一问题(特别是在Django应用程序中)苦苦挣扎的其他人
来说wwwroot-但是作为tarball。然后将代码提取到TMP并在此文件夹中执行。这会引起运行Django迁移的挑战,这里没有迁移历史记录。)和您无法从wwwroot运行迁移(因为新代码仅存在于tarball中)。因此,为了持续迁移历史记录,您将需要:
或
For others that may be struggling with this same issue, specifically with Django applications, I have landed on the following workaround:
After learning more about how Oryx build actually works, I now understand that the code IS copied to wwwroot - but as a tarball. The code is then extracted to tmp and executed in this folder. This causes a challenge running django migrations as the migration folder is not persistent at the location where the code is run from, i.e. you are not able to run migrations automatically from the tmp folder (because, assuming you are not putting your migrations in source control, there is no migration history here.) and you are not able to run migrations from wwwroot (because the new code only exists in the tarball). So, in order to persist migration history you will need to:
OR