diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 67e28fda0..d1dafdd09 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -1,25 +1,47 @@ +# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins + name: cd on: workflow_dispatch: check_run: types: - - completed + - completed + jobs: - deploy: + validate: runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }} + steps: + - name: Verify CI status + uses: jenkins-infra/verify-ci-status-action@v1.2.0 + id: verify-ci-status + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + output_result: true + + - name: Release Drafter + uses: release-drafter/release-drafter@v5 + if: steps.verify-ci-status.outputs.result == 'success' + with: + name: next + tag: next + version: next + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check interesting categories + uses: jenkins-infra/interesting-category-action@v1.0.0 + id: interesting-categories + if: steps.verify-ci-status.outputs.result == 'success' + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + release: + runs-on: ubuntu-latest + needs: [validate] + if: needs.validate.outputs.should_release == 'true' steps: - - name: Verify CI status - uses: jenkins-infra/verify-ci-status-action@v1.2.0 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Release Drafter - uses: release-drafter/release-drafter@v5.15.0 - with: - name: next - tag: next - version: next - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check out uses: actions/checkout@v2.3.4 with: diff --git a/pom.xml b/pom.xml index bf9b3a844..a0cc909af 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ THE SOFTWARE. 999999-SNAPSHOT UTF-8 - 9.4.39.v20210325 + 9.4.40.v20210413 2.2 1.29 8 @@ -268,7 +268,7 @@ THE SOFTWARE. org.apache.ant ant - 1.10.9 + 1.10.10 diff --git a/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java b/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java index a3a54d06b..88bcfce69 100644 --- a/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java +++ b/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java @@ -411,8 +411,14 @@ public void startJenkins() throws Throwable { public void stopJenkins() throws Throwable { endpoint("exit").openStream().close(); - if (proc.waitFor() != 0) { - throw new AssertionError("nonzero exit code"); + if (!proc.waitFor(60, TimeUnit.SECONDS) ) { + System.err.println("Jenkins failed to stop within 60 seconds, attempting to kill the Jenkins process"); + proc.destroyForcibly(); + throw new AssertionError("Jenkins failed to terminate within 60 seconds"); + } + int exitValue = proc.exitValue(); + if (exitValue != 0) { + throw new AssertionError("nonzero exit code: " + exitValue); } proc = null; } @@ -500,7 +506,9 @@ public static void register() throws Exception { }); JenkinsRule._configureUpdateCenter(j); System.err.println("RealJenkinsRule ready"); - Timer.get().scheduleAtFixedRate(JenkinsRule::dumpThreads, 2, 2, TimeUnit.MINUTES); + if (!new DisableOnDebug(null).isDebugging()) { + Timer.get().scheduleAtFixedRate(JenkinsRule::dumpThreads, 2, 2, TimeUnit.MINUTES); + } } @Override public String getUrlName() { return "RealJenkinsRule";