CI_VSTS publish different web Artifact for each pr

2019-08-24 08:29发布

I have a CI pipeline(VSTS) in which I am able to build whole solution which has two website projects in it in a single artifact. What I want to do it build whole solution and then create publish artifact for each project. e.g. One artifact for Project_website1 One artifact for Project_website2 thanks. I tried similar topic in StackOverflow but didnt work for me

3条回答
疯言疯语
2楼-- · 2019-08-24 08:46

To publish the two websites projects’ artifacts separately, you just need to use two VS build tasks and two Publish Build Artifacts tasks to build and publish the two websites separately.

enter image description here

Such as the first VS build task and Publish Build Artifacts task are for website1, and the second VS build task and Publish Build Artifacts task are for website2. The detail configurations for each task as below:

  • VS build task for website1 (store the package for website1 in $(build.artifactstagingdirectory)\web1):

    enter image description here

  • Publish Build Artifacts for website1 (publish website1’s artifacts from $(build.artifactstagingdirectory)\web1 to artifact web1):

    enter image description here

  • VS build for website2 (store the package for website2 in $(build.artifactstagingdirectory)\web2):

    enter image description here

  • Publish Build Artifacts for website2 (publish website2’s artifacts from $(build.artifactstagingdirectory)\web2 to web2):

    enter image description here

Then you can get build artifacts for the two projects separately:

enter image description here

查看更多
倾城 Initia
3楼-- · 2019-08-24 08:50

You can use two publish artifacts tasks and may be copy files multiple tasks to achieve any number of artifact in VSTS build. For example, say you have your current artifacts for a single project, comprising of _PublishedWebsites\MVS5WebApp (XCopy deployable website) and _PublishedWebsites\MVS5WebApp_Package (web deploy package). enter image description here If you want to separate these two, into two artifacts, you can use two Publish Artifact tasks as shown below, each one specifying exact path to publish (this path does not support wildcards, you just have to specify the folder you need to publish).

enter image description here enter image description here

Result would be two artifacts enter image description here

You can get more idea from the post here. Also this post might be useful for you to understand more possibilities.

查看更多
仙女界的扛把子
4楼-- · 2019-08-24 08:56

This is what I have done As I am using my own agent So the web projects are published in agent’s each project published directory. That is directory a.

Solution: All i did was after builidng the whole solution once vsts put all website in publish directory a. I wrote powershell script to get each file for project and put it under subdirectory in published folder a.

E.g Publish folder a will look like this after building solution Website1.......xml Website1.......zip . . . Website2........xml Website2........zip . . .

Etc When solution is build the files will be in above folder togeter.

In order to build artifact for each project i wrote powershell script to put each project file in sub directory E.g a\website1 Website1.......xml Website1.......zip

a\website2 Website2.......xml Website2.......zip

Etc and so on

After that select each publish artifact for each directory and you can have artifact for each project. Thanks

查看更多
登录 后发表回答