forked from dennyzhang/cheatsheet-jenkins-groovy-A4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kubernetes cloud; add jobs to view by regexp
- Loading branch information
1 parent
af9fa48
commit cb6dcbe
Showing
4 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<views> | ||
<hudson.model.AllView> | ||
<owner class="hudson" reference="../../.."/> | ||
<name>all</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
</hudson.model.AllView> | ||
<com.smartcodeltd.jenkinsci.plugins.buildmonitor.BuildMonitorView plugin="[email protected]+build.201809061734"> | ||
<owner class="hudson" reference="../../.."/> | ||
<name>AutoReport</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
<jobNames> | ||
<comparator class="hudson.util.CaseInsensitiveComparator"/> | ||
<string>DetectTestbedFormatChanges</string> | ||
<string>MonitorDownloadURLs</string> | ||
<string>NightlyProvisionBasicTest</string> | ||
<string>NightlyProvisionGear2Test</string> | ||
<string>NightlyProvisionIntegrationTest</string> | ||
<string>ProvisionPKSEnvNimbus</string> | ||
<string>ProvisionPKSEnvNimbusAdvancew</string> | ||
</jobNames> | ||
<jobFilters/> | ||
<columns/> | ||
<recurse>false</recurse> | ||
<title>AutoReport</title> | ||
<config> | ||
<displayCommitters>false</displayCommitters> | ||
<buildFailureAnalyzerDisplayedField>Name</buildFailureAnalyzerDisplayedField> | ||
<order class="com.smartcodeltd.jenkinsci.plugins.buildmonitor.order.ByName"/> | ||
</config> | ||
</com.smartcodeltd.jenkinsci.plugins.buildmonitor.BuildMonitorView> | ||
</views> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!groovy | ||
//------------------------------------------------------------------- | ||
// @copyright 2018 DennyZhang.com | ||
// Licensed under MIT | ||
// https://www.dennyzhang.com/wp-content/mit_license.txt | ||
// | ||
// File: jenkins-kubernetes-cloud.groovy | ||
// Author : Denny <https://www.dennyzhang.com/contact> | ||
// Link: https://cheatsheet.dennyzhang.com/cheatsheet-jenkins-groovy-a4 | ||
// -- | ||
// Created : <2018-04-20> | ||
// Updated: Time-stamp: <2019-05-23 22:30:46> | ||
//------------------------------------------------------------------- | ||
// https://github.com/carlossg/jenkins-kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesCloud.java | ||
import org.csanchez.jenkins.plugins.kubernetes.* | ||
import jenkins.model.* | ||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.KubernetesClientException; | ||
try { | ||
def j = Jenkins.getInstance() | ||
def client = j.clouds[0].connect() | ||
client.pods().list(); | ||
} catch (KubernetesClientException e) { | ||
println("Error testing connection %s" + e.getMessage()) | ||
} catch (Exception e) { | ||
println("Error testing connection %s" + e.getMessage()) | ||
} |