How to save artifacts in Bitbucket-Pipelines

后端 未结 3 1168
我寻月下人不归
我寻月下人不归 2021-02-14 12:48

I am new to bamboo. What I try to do is collecting all .dacpac files that are created during the build process.

image: microsoft/dotnet:latest
pipe         


        
3条回答
  •  天命终不由人
    2021-02-14 13:44

    In bitbucket-pipelines.yml, whenever you progress to a different "step:", it will reset almost everything and behave independently to a previous step. This is not always obvious, and can be confusing.

    In your previous step, you moved into a sub-folder using cd BackgroundCode. When the script progresses to the "artifacts:" step, the current working directory will reset back to its original $BITBUCKET_CLONE_DIR. So you need to cd BackgroundCode again in each step or use a path that's relative to the $BITBUCKET_CLONE_DIR, like this:

    artifacts:
     - BackgroundCode/**/*.dacpac
    

    or

    step2:
     - cd BackgroundCode
     # List the files relative to the 'BackgroundCode' directory
     - find . -iname '*.dacpac'
    

    This will now save the artifact automatically (for 7 days), and you can see it in the "Artifacts" tab at the top.

提交回复
热议问题