Nanda
Nanda

Reputation: 115

how to automate Jenkins task for removing a file in github

I am working on Jenkins automation and Jenkins is running in windows server. we are able to checkout the code from Github and build it.

But after the build I want to delete a **.war file in github from Jenkins.

Do we have any plugin for that in Jenkins?

Upvotes: 1

Views: 102

Answers (1)

VonC
VonC

Reputation: 1323593

There should not been any .war binary file in the GitHub repo itself.

There are binaries in GitHub releases, and you can use the GitHub Release API to delete (and then recreate) a release if you need to cleanup the wars produced by the previous build.
(Although, if your build runs every few minutes, you probably do not want to store the build result in GitHub every time)
You can see one example with this python script.
Or you can use one of the GitHub API libraries available.

Upvotes: 1

Related Questions