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 com.atlassian.jira.ComponentManager | |
import com.atlassian.jira.project.Project | |
import com.atlassian.jira.project.ProjectManager | |
import com.atlassian.jira.security.roles.ProjectRole | |
import com.atlassian.jira.security.roles.ProjectRoleActors | |
import com.atlassian.jira.security.roles.ProjectRoleManager | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.project.ProjectCategory | |
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 com.atlassian.jira.component.ComponentAccessor | |
def schemeManager = ComponentAccessor.workflowSchemeManager | |
def sb = new StringBuffer() | |
def schemes = schemeManager.getAssignableSchemes() | |
if(schemes != null) { | |
schemes.each { | |
if (schemeManager.isActive(it)) { | |
sb.append("|||||| Skipping active wf scheme: ${it.name} \n") |
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 com.atlassian.jira.component.ComponentAccessor | |
def workflowManager = ComponentAccessor.workflowManager | |
def schemeManager = ComponentAccessor.workflowSchemeManager | |
def sb = new StringBuffer() | |
// get 2 weeks ago date | |
today = new java.sql.Timestamp(new Date().getTime() - 120960000) |
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
docker run \ | |
--name={{.Name}} \ | |
{{range $e := .Config.Env}}--env="{{$e}}" \ | |
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \ | |
{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from="{{.}}" \ | |
{{end}}{{range $v := .HostConfig.Binds}}--volume="{{.}}" \ | |
{{end}}{{range $l, $v := .Config.Labels}}--label "{{$l}}"="{{$v}}" \ | |
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{.}} \ | |
{{end}}{{range $v := .HostConfig.CapDrop}}--cap-drop {{.}} \ | |
{{end}}{{range $d := .HostConfig.Devices}}--device={{(index $d).PathOnHost}}:{{(index $d).PathInContainer}}:{{(index $d).CgroupPermissions}} \ |
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 script will reuse GIT_BRANCH variable from the last successful job, if current BRANCH parameter is empty | |
def branch="$BRANCH" | |
println "currentJob --> ${currentJob}" | |
println "currentBuild --> ${currentBuild}" | |
if (branch=="") { | |
try { | |
println "setting BRANCH from the last build" |
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 hudson.model.* | |
def q = Jenkins.instance.queue | |
def JOB_PATTERN = ~/^tools.merge_master.*$/; //find all jobs starting with "MY_JOB". | |
(q.items.findAll { it.task.name =~ JOB_PATTERN }).each { | |
println ("Cancelling task " + it.task.name); | |
q.cancel(it.task) | |
} |
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
// Groovy script to rename job in Hudson | |
import hudson.model.*; | |
def JOB_PATTERN = ~/^GO.*.deploy_container.staging*$/; //find all jobs starting with "MY_JOB". | |
def NEW_PART = "_NEW" | |
(Hudson.instance.items.findAll { job -> job.name =~ JOB_PATTERN }).each { job_to_update -> | |
if (job_to_update.name =~ "GO.bob_api.*") { | |
return; | |
} |
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
// Groovy script to disable job in Hudson | |
import hudson.model.*; | |
def JOB_PATTERN = ~/^GO.*.deploy*.staging2$/; //find all jobs starting with "MY_JOB". | |
(Hudson.instance.items.findAll { job -> job.name =~ JOB_PATTERN }).each { job_to_update -> | |
if (job_to_update.name =~ "^\$") { | |
return; | |
} | |
else { |
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.* | |
import hudson.model.ListView | |
import hudson.model.* | |
import hudson.plugins.nested_view.* | |
def name_parent = 'GO' | |
def name_component = 'Component1_VIEW' | |
def name_repo = 'repo_regex' | |
def viewObj = Jenkins.instance.getView(name_parent) //lvl 1 |
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
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strconv" | |
) |
NewerOlder