Kevin-Mok / kogito-runtimes

Runtimes for Kogito
http://kogito.kie.org
Apache License 2.0
0 stars 1 forks source link

Refactoring checkout in Jenkinsfile.deploy #2

Open Kevin-Mok opened 4 years ago

Kevin-Mok commented 4 years ago

Currently, each build stage in Jenkinsfile.deploy has an unwieldy long line of code to checkout the repository:

https://github.com/Kevin-Mok/kogito-runtimes/blob/2fe5b346f10e67cf07c24d0660ca1dacd4538120/Jenkinsfile.deploy.new#L39

If I'm not mistaken, there doesn't seem like there's anything too special there that couldn't be replaced with a more familiar line like in Jenkinsfile.release:

https://github.com/Kevin-Mok/kogito-runtimes/blob/2fe5b346f10e67cf07c24d0660ca1dacd4538120/Jenkinsfile.release#L26-L27

Or even better, using the checkout function from the shared library:

checkoutIfExists("kogito-runtimes", "kiegroup", "master", "kiegroup", "master")

This goes hand-in-hand with #1 such that all the cloning could be in a single stage with cleaner syntax.

radtriste commented 4 years ago

I already thought about reusing the shared library. we could also do: checkout(githubScm.resolveRepository("kogito-runtimes", "kiegroup", env.BRANCH_NAME, false))