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
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] |
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 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 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 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 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 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
search("groups", "*:*").each do |group_data| | |
group group_data["id"] do | |
gid group_data["gid"] | |
members group_data["members"] | |
end | |
end |
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
# | |
# Cookbook Name:: users | |
# Recipe:: default | |
# | |
# Copyright (c) 2016 The Authors, All Rights Reserved. | |
search("users", "*:*").each do |user_data| | |
user user_data["id"] do | |
comment user_data["comment"] | |
uid user_data["uid"] |
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
{ | |
"id": "clowns", | |
"gid": 3000, | |
"members": ["bobo", "frank"] | |
} |
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
{ | |
"id": "frank", | |
"comment": "Frank Belson", | |
"uid": 2001, | |
"gid": 0, | |
"home": "/home/frank", | |
"shell": "/bin/bash" | |
} |
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
{ | |
"id": "bobo", | |
"comment": "Bobo T. Clown", | |
"uid": 2000, | |
"gid": 0, | |
"home": "/home/bobo", | |
"shell": "/bin/bash" | |
} |
NewerOlder