-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Add enforce maven plugin to do snapshot version check #4157
Conversation
What command does jenkins job run? |
Jenkins will run
to check all version are snapshot. And for deployment, it will run
And for commit status check will use a groovy script to do import groovy.json.JsonSlurper
import java.io.File
def env = System.getenv()
def commitId = env["GIT_COMMIT"]
println "Current commit id: $commitId"
String commitStatusJson = new URL("https://api.github.com/repos/apache/dubbo/commits/$commitId/status").text
println "Commit status: \r\n$commitStatusJson"
def jsonSlurper = new JsonSlurper()
def jsonObject = jsonSlurper.parseText(commitStatusJson)
def status = jsonObject.state
println "Current commit status is $status"
if (status == "sucesss") {
def newFile = new File("CONTINUE_DEPLOY_FLAG")
newFile.createNewFile()
println "Continue to deploy snapshot"
} else {
println "Current commit status not allow to deploy snapshot"
} |
So the Jenkins job workflow is:
Is my understanding correct? |
Yeah. but for the first one, it will check every 6 hours. Please refer to latest successfully build: https://builds.apache.org/job/Apache%20Dubbo/job/apache-dubbo-snapshot-deployment/16/ The next step I will try to convert this jenkins job config to a Jenkinsfile(https://jenkins.io/doc/book/pipeline/jenkinsfile/), it will make things more clear and easy to maintain. With Jenkinsfile everyone can see Jenkins job config and send a PR to modify it without Apache account and group access |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please merge it once CI pass.
Codecov Report
@@ Coverage Diff @@
## master #4157 +/- ##
=========================================
Coverage ? 62.89%
Complexity ? 505
=========================================
Files ? 768
Lines ? 33064
Branches ? 5220
=========================================
Hits ? 20794
Misses ? 9869
Partials ? 2401 Continue to review full report at Codecov.
|
What is the purpose of the change
Creating a jenkins job for deploying snapshot version to apache maven repo.
In order to make everything works well, we need prevent release deploy for this job, so try to add a enforce plugin rule to check all version is snapshot version.
Brief changelog
modify pom.xml and add new enforce plugin
Verifying this change
CI pass with
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.