projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

.git folder gets copied in some cases in Linux Web App Deployment #2673

Closed blueelvis closed 6 months ago

blueelvis commented 6 years ago

Repro steps.

Using the default deployment script for PHP projects. Project is a drupal installation

Project structures.

Normal Drupal structure

The log/error given by the failure.

No error is generated as part of the whole deployment

Mention any other details that might be useful.

  1. I am performing a local git deployment to the Azure Web App for containers.
  2. I see in some cases that the wwwroot folder gets populated with the .git folder which is not best practice.
  3. I see in the log the following -
    
    remote: Updating branch 'master'.        

remote: .........

remote: Updating submodules.
remote: Preparing deployment for commit id 'd4b51d6d0a'.
remote: Running custom deployment command...
remote: Running deployment command...

remote: PHP deployment
remote: No COMPOSER_ARGS variable declared in App Settings, using the default settings
remote: Composer settings: --no-interaction --prefer-dist --optimize-autoloader --no-progress --verbose
remote: /home/site/wwwroot
remote: Found composer.json
remote: ~/site/wwwroot ~/site/wwwroot
remote: Loading composer repositories with package information
remote: Installing dependencies (including require-dev) from lock file
remote: Dependency resolution completed in 0.001 seconds
remote: Analyzed 187 packages to resolve dependencies
remote: Analyzed 477 rules to resolve dependencies
remote: Package operations: 136 installs, 0 updates, 0 removals


For a clean web app on a different app service plan but same code repository, I see the following -

remote: Updating branch 'master'.
remote: ..........
remote: Updating submodules.
remote: Preparing deployment for commit id 'd4b51d6d0a'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: PHP deployment
remote: Kudu sync from: '/home/site/repository' to: '/home/site/wwwroot'
remote: Copying file: '.csslintrc'
remote: Ignoring: .deployment
remote: Copying file: '.editorconfig'
remote: Copying file: '.eslintignore'
remote: Copying file: '.eslintrc'
remote: Copying file: '.eslintrc.json'
remote: Copying file: '.gitattributes'
remote: Copying file: '.gitignore'
remote: Copying file: '.htaccess'
remote: Copying file: 'LICENSE.txt'
remote: Copying file: 'README.txt'
remote: Copying file: 'autoload.php'
remote: Copying file: 'composer.json'
remote: Copying file: 'composer.lock'
remote: Ignoring: deploy.sh
remote: Copying file: 'example.gitignore'
remote: Copying file: 'index.php'
remote: Copying file: 'robots.txt'
remote: Copying file: 'update.php'
remote: Copying file: 'web.config'
remote: Ignoring: .git
remote: Copying file: 'modules/README.txt'



Any idea what might be happening?

Thanks,
Pranav
nickwalkmsft commented 6 years ago

Your first deployment log appears to be for an app that is doing an in-place deployment. That's why kudusync isn't running and why everything, including .git, is in the target folder. See here. Have you configured that app in this way?

blueelvis commented 6 years ago

@nickwalkmsft - Nope. I don't have those settings defined in the Web Apps Application Settings for both of the web apps...

rramachand21-zz commented 6 years ago

@blueelvis, was this issue fixed after you followed steps in https://github.com/projectkudu/kudu/wiki/Deploying-inplace-and-without-repository

blueelvis commented 6 years ago

@rramachand21 - I didn't set inplace deployment for this and earlier the source code was getting copied properly but in this case, it didn't work properly.

patricklee2 commented 6 years ago

@blueelvis Can you provide a more detailed reproduction? I was unable to repro the error by following https://docs.microsoft.com/en-us/azure/app-service/app-service-deploy-local-git

blueelvis commented 6 years ago

@patricklee2 - I was not able to reproduce this since quite some time now. It could be a hiccup. Do you have any alternate thoughts on this?

patricklee2 commented 6 years ago

@blueelvis Feel free to reopen this issue if the problem reappears. @nickwalkmsft @davidebbo We can not repro this, please close this issue

jvano commented 6 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service