From 02e75793cf7568ed4093618b425e98290c1613ed Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Tue, 19 Sep 2023 16:12:01 +0100 Subject: [PATCH] modernize plugin (#4) * enable cd, update to 2.387.3 * fix htmlunit --- .github/dependabot.yml | 10 ++++++ .github/workflows/cd.yaml | 15 ++++++++ .github/workflows/jenkins-security-scan.yml | 20 +++++++++++ .mvn/extensions.xml | 7 ++++ .mvn/maven.config | 3 ++ Jenkinsfile | 5 +++ README.md | 6 ++++ pom.xml | 34 ++++++++++++++----- .../AlternateBuildNowTest.java | 2 +- 9 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/cd.yaml create mode 100644 .github/workflows/jenkins-security-scan.yml create mode 100644 .mvn/extensions.xml create mode 100644 .mvn/maven.config create mode 100644 Jenkinsfile create mode 100644 README.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..66f21a7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: +- package-ecosystem: maven + directory: "/" + schedule: + interval: monthly +- package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..0279984 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,15 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins + +name: cd +on: + workflow_dispatch: + check_run: + types: + - completed + +jobs: + maven-cd: + uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 + secrets: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} diff --git a/.github/workflows/jenkins-security-scan.yml b/.github/workflows/jenkins-security-scan.yml new file mode 100644 index 0000000..267efd0 --- /dev/null +++ b/.github/workflows/jenkins-security-scan.yml @@ -0,0 +1,20 @@ +name: Jenkins Security Scan +on: + push: + branches: + - "master" + pull_request: + types: [ opened, synchronize, reopened ] + workflow_dispatch: + +permissions: + security-events: write + contents: read + actions: read + +jobs: + security-scan: + uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2 + with: + java-cache: '' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate. + java-version: 11 # What version of Java to set up for the build. diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 0000000..1f36364 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,7 @@ + + + io.jenkins.tools.incrementals + git-changelist-maven-extension + 1.7 + + diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 0000000..f7daf60 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1,3 @@ +-Pconsume-incrementals +-Pmight-produce-incrementals +-Dchangelist.format=%d.v%s diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..15572b3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +buildPlugin( + useContainerAgent: true, + configurations: [ + [platform: 'linux', jdk: 11] +]) diff --git a/README.md b/README.md new file mode 100644 index 0000000..aecb0e9 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +Customize Build Now Plugin +========== + +This plugin allows users to provide an alternate label to "Build Now". While its well understood by Jenkins experts +what "Build Now" means, sometimes its more intuitive for new Jenkins users to associate a more appropriate label to +suite the purpose of the job like "Deploy Now" or "Execute Now" or "Promote Now" etc... \ No newline at end of file diff --git a/pom.xml b/pom.xml index 65b4ec1..858ab43 100644 --- a/pom.xml +++ b/pom.xml @@ -5,25 +5,30 @@ org.jenkins-ci.plugins plugin - 1.625 + 4.73 org.jenkins-ci.plugins customize-build-now - 1.2-SNAPSHOT + ${changelist} hpi Customize Build Now Label Provide an alternate label to 'Build Now' to run a job - https://wiki.jenkins-ci.org/display/JENKINS/Customize+Build+Now+Plugin + https://github.com/jenkinsci/customize-build-now-plugin MIT License - http://opensource.org/licenses/MIT + https://opensource.org/licenses/MIT + + 999999-SNAPSHOT + 2.387.3 + + uday @@ -35,28 +40,39 @@ scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git - http://github.com/jenkinsci/${project.artifactId}-plugin + https://github.com/jenkinsci/${project.artifactId}-plugin HEAD repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ + https://repo.jenkins-ci.org/public/ repo.jenkins-ci.org - http://repo.jenkins-ci.org/public/ + https://repo.jenkins-ci.org/public/ + + + + io.jenkins.tools.bom + bom-2.387.x + 2446.v2e9fd3b_d8c81 + pom + import + + + + org.jenkins-ci.plugins.workflow - workflow-aggregator - 1.10 + workflow-job test diff --git a/src/test/java/org/jenkinsci/plugins/customizebuildnow/AlternateBuildNowTest.java b/src/test/java/org/jenkinsci/plugins/customizebuildnow/AlternateBuildNowTest.java index c2660f2..0cfdf17 100644 --- a/src/test/java/org/jenkinsci/plugins/customizebuildnow/AlternateBuildNowTest.java +++ b/src/test/java/org/jenkinsci/plugins/customizebuildnow/AlternateBuildNowTest.java @@ -1,6 +1,6 @@ package org.jenkinsci.plugins.customizebuildnow; -import com.gargoylesoftware.htmlunit.html.HtmlPage; +import org.htmlunit.html.HtmlPage; import hudson.model.FreeStyleProject; import jenkins.model.Messages; import org.jenkinsci.plugins.workflow.job.WorkflowJob;