skip to Main Content

I apologize for my english, im using a translator.

I need make a deployment on Azure Devops using Continous Deployment but i need exclude a file from the repository (i cant change the repository) then create a deployment in IIS.

I have a WebService file in the repository but i cant ignore or delete it from git. I need to use Azure Devops to ignore it then make a continuous deployment.

2

Answers


  1. You can use the task Delete Files, as covered below:

    # Delete files
    # Delete folders, or files matching a pattern
    - task: DeleteFiles@1
      inputs:
        #SourceFolder: # Optional
        #Contents: 'myFileShare' 
        #RemoveSourceFolder: # Optional
    

    The input source folder can be folder $(rootFolder) or $(Build.ArtifactStagingDirectory).

    I’ve had a similar problem and solved it this way. Especially .git or .vsfolder.

    Login or Signup to reply.
  2. Another approch is also to use .artifactsignore. By including this file you can describe which files you want to ignore before building the artifacts package. The tricky part here is correct placing of the file.
    Where you save the .artifactignore file depends which path you have specified for the publish pipeline artifact task in your pipeline definition.
    Here is good example which helped me to use it:
    https://www.jfe.cloud/control-pipeline-artifacts-with-artifactignore-file/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search