I have release definition that publishes a web app and database. As part pic that definition I am generating release notes into a .md file and manually uploading them to the projects wiki page on VSTS. I was wondering if there was a way to add a task to the release definition to automate the publishing of the release notes to the wiki.
Since each team project wiki employs a git repository backend, you can clone that wiki repository and add or edit pages, then commit and push changes.
Clone and update wiki pages offline
The simple way:
git
; Arguments: clone https://test:$(System.AccessToken)@xxx.visualstudio.com/xxxx mywiki
; Working folder: $(build.sourcesdirectory)
)git
; Arguments: config --global user.email "[email protected]"
; Working folder: $(build.sourcesdirectory)\mywiki
)git
; Arguments: config --global user.name "tester"
; Working folder: $(build.sourcesdirectory)\mywiki
)git
; Aguments: add *
; Working folder: $(build.sourcesdirectory)\mywiki
)git
; Aguments: commit -m "update wikipage"
; Working folder: $(build.sourcesdirectory)\mywiki
)git
; Aguments: push https://test:$(System.AccessToken)@xx.visualstudio.com/xxx
; Working folder: $(build.sourcesdirectory)\mywiki
)You can put the commands of step 3 ~ 7 in a file (e.g. bat, ps1), then just add a task and specify the file.
Note: The Project Collection Build Service account needs Contribute permission (Version Control admin page and set permission for Git repositories)