In the ArchiveFiles
task, change includeRootFolder: true
to includeRootFolder: false
so it adds the files in the s
folder to the ZIP but not the folder itself.
How to Deploy my php application on Windows Webapp
Jason Zwanepoel
66
Reputation points
Hi all hope you can assist
I have an Azure pipeline to build and zip my code and then add push artifact
When I do this I noticed that my Code files gets added to a folder called 's'
Below you will find what I have attempted to set up and attatched you will see my Deployment
Please Assist me I need to make the code go under my wwwroot folder and not wwwroot\s
My azure-pipelines.yml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
phpVersion: 7.2
steps:
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
displayName: 'Use PHP version $(phpVersion)' - script: composer install --no-interaction --prefer-dist
displayName: 'composer install' - task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true - task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
Kind Regards
Accepted answer
-
Mark Allan 426 Reputation points
2020-06-02T21:14:40.307+00:00