This file contains hidden or 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 Groovy snippet is used for Jenkins Job DSL groovy script, | |
| // when ... | |
| // 1. enable Jenkins Global Security | |
| // 2. use pipelineJob | |
| // 3. want to approve pipeline cps automatically | |
| // | |
| import jenkins.model.Jenkins |
This file contains hidden or 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
| # clean old properties and script file | |
| rm -rf * | |
| # copy the latest properties and script file | |
| cp -rf /var/lib/jenkins/dsl-repo/config ./ | |
| cp -rf /var/lib/jenkins/dsl-repo/dsl ./ | |
| cp -rf /var/lib/jenkins/dsl-repo/pipeline ./ | |
| # reload pipeline global library | |
| rm -rf /tmp/workflowLibs |
This file contains hidden or 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 groovy.json.* | |
| def deploy(phase, version, user, branch, status = 'Success', region = 'Oregon', channel = 'none', repoer = 'true', repo_host, repo_owner) { | |
| def slack_info = slack_info.load() | |
| def http_client = new com.droi.pipeline.jenkins.httpRequest(slack_info.hook_protocol, slack_info.hook_fqdn, slack_info.hook_port.toInteger()) | |
| def header = ["Content-Type": "application/json"] | |
| def url = "${slack_info.hook_protocol}://${slack_info.hook_fqdn}/${slack_info.hook_uri}" | |
| def response = [:] |
This file contains hidden or 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 jenkins.model.Jenkins | |
| // define global variable | |
| def job_folder = 'job_folder' | |
| def job_name = 'job_name' | |
| pipelineJob("${job_folder}/${job_name}") { | |
| triggers { | |
| gitlab { |
This file contains hidden or 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
| repos: | |
| - id: /.*/ | |
| # apply_requirements sets the Apply Requirements for all repos that match. | |
| apply_requirements: [mergeable] | |
| # workflow sets the workflow for all repos that match. | |
| # This workflow must be defined in the workflows section. | |
| allowed_overrides: [workflow] |
OlderNewer