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
import org.boozallen.plugins.jte.config.*; | |
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; | |
import org.jenkinsci.plugins.github_branch_source.GitHubSCMSource; | |
import hudson.plugins.git.GitSCM; | |
import hudson.plugins.git.BranchSpec; | |
import hudson.plugins.git.UserRemoteConfig; | |
import jenkins.branch.BranchSource; | |
import org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait; | |
import org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait; | |
import jenkins.scm.api.trait.SCMSourceTrait; |
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
def plugins = [:] | |
Jenkins.instance.pluginManager.plugins.each{ plugin -> | |
plugins[plugin.getShortName()] = plugin.getVersion() | |
} | |
plugins.keySet().sort().each{ shortName -> | |
println "${shortName}:${plugins.getAt(shortName)}" | |
} |
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
import java.util.ArrayList | |
import hudson.model.*; | |
// Remove everything which is currently queued | |
def q = Jenkins.instance.queue | |
for (queued in Jenkins.instance.queue.items) { | |
q.cancel(queued.task) | |
} | |
// stop all the currently running jobs |
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
import static groovy.json.JsonOutput.* | |
def config = [ | |
/* | |
some map | |
*/ | |
] | |
println prettyPrint(toJson(config)) |
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
import org.jenkinsci.plugins.pipeline.modeldefinition.parser.Converter | |
import org.jenkinsci.plugins.pipeline.modeldefinition.parser.JSONParser | |
import net.sf.json.JSONObject | |
import org.yaml.snakeyaml.Yaml | |
import com.github.fge.jsonschema.tree.JsonTree | |
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef | |
String yamlString = """ | |
pipeline: | |
stages: |
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
# from: https://stackoverflow.com/a/47776588 | |
# which service account? | |
SA= | |
NAMESPACE= | |
# your k8s api endpoint goes here | |
server=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ") | |
# the name of the secret containing the service account token goes here |
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
variable "field_A" { | |
type = string | |
default = "default value A" | |
} | |
output "field_A" { | |
value = var.field_A | |
} | |
variable "field_B" { |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: test-config-${int} | |
namespace: default | |
data: | |
something: "value" |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: jenkins-agent | |
name: jenkins-agent | |
namespace: demo | |
spec: | |
replicas: 2 | |
selector: |
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
import example.GitServerProvider | |
ExtensionPoint.lookup(GitServerProvider).each{ s -> | |
def provider = s.newInstance() | |
provider.doThingOne() | |
provider.doThingTwo() | |
} |
OlderNewer