首页 > 解决方案 > Azure 应用服务 (Linux) CI/CD 构建不会删除从存储库中删除的文件

问题描述

我正在使用Azure App Service (Linux) App Service Build Service (CI/CD) 来部署 PHP 应用程序。

我删除了这些文件(package.json、eraseme.php),但是当站点部署到 Azure 时,这些文件并没有从 /wwwroot 中删除。

Azure 应用服务生成服务执行以下操作:

当我列出“/repository”目录的内容时,我删除的文件不存在。该目录正确地反映了我的 GIT 存储库的“主”分支。

但是,当文件移动到“/wwwroot”时,package.json 和 eraseme.php 文件仍然存在。

有没有其他人遇到过这个问题?如果是这样,我将不胜感激您愿意提供的任何帮助。

Azure CI/CD 部署的日志:

4:45:08 PM - Updating submodules.
4:45:10 PM - Preparing deployment for commit id 'da0f786f06'.
4:45:10 PM - Repository path is /home/site/repository
4:45:10 PM - Running oryx build...  (See Oryx logs below)
4:47:23 PM - Running post deployment command(s)...
4:47:24 PM - Triggering recycle (preview mode disabled).
4:47:24 PM - Deployment successful.

羚羊原木

Command: oryx build /home/site/repository -o /home/site/wwwroot --platform php --platform-version 7.3 -i /tmp/8d8ea4eb902b3c0 --log-file /tmp/build-debug.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1

Build Operation ID: |G/7ihko0yFs=.b39d9a41_
Repository Commit : da0f786f0646fc957398a50da31f19aff35f6193

Detecting platforms...
Detected following platforms:
php: 7.3.26

Using intermediate directory '/tmp/8d8ea4eb902b3c0'.

Copying files to the intermediate directory...
Done in 52 sec(s).

Source directory : /tmp/8d8ea4eb902b3c0
Destination directory: /home/site/wwwroot

PHP executable: /tmp/oryx/platforms/php/7.3.26/bin/php
Composer archive: /opt/php-composer/1.9.3/composer.phar
Running 'composer install --ignore-platform-reqs --no-interaction'...

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 5 installs, 0 updates, 0 removals
- Installing ckdarby/silverpopphp (dev-master 3b8c5ed): Cloning 3b8c5ed525 from cache
- Installing robrichards/xmlseclibs (dev-master 0f54660): Cloning 0f5466070e from cache
- Installing robrichards/wse-php (2.0.3): Loading from cache
- Installing firebase/php-jwt (dev-master bac0422): Cloning bac0422822 from cache
- Installing salesforce-mc/fuel-sdk-php (dev-master 8018468): Cloning 8018468706 from cache
Generating autoload files
Preparing output...

Copying files to destination directory '/home/site/wwwroot'...
Done in 31 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.

Done in 88 sec(s).

标签: azure-web-app-servicecontinuous-deploymentgithub-actionsazure-git-deploymentoryx

解决方案


看来您部署了两次。第一次包含package.jsonand eraseme.php,但第二次没有。

实际上 kudu 站点中已经存在的文件会被同名覆盖,但如果新项目不包含这些文件,则不会被删除。这不会影响您的网络应用程序,您可以手动删除它们


推荐阅读