Skip to content

Instantly share code, notes, and snippets.

View melvinpetix's full-sized avatar

melvinpetix melvinpetix

View GitHub Profile
@sandfox
sandfox / README.md
Created September 8, 2012 18:11
Jenkins Slave set-up script
@tdeckers-cisco
tdeckers-cisco / bootstrap-ansible.sh
Last active May 10, 2023 03:27
Install Ansible on RHEL6
#!/usr/bin/env bash
#
# Invoke this bootstrap using:
# bash < <(curl -s -L https://raw.github.com/gist/5813672/bootstrap-ansible.sh)
# (this should be run as root)
#
# move to working dir.
cd /tmp
@TheMightyLlama
TheMightyLlama / jira-curl.sh
Last active November 16, 2023 18:22
Perform actions on a jira issue via curl
#Creates a new issue with custom fields
curl -D- -u uname:pass -X POST --data "{\"fields\": {\"project\": { \"id\": \"10430\" },\"summary\": \"This is a test issue\", \"description\": \"Description\",\"issuetype\": { \"id\" : \"1\"}, \"components\" : [{\"id\":\"10731\"}], \"customfield_10711\" : [{\"id\":\"10500\"}] } }" -H "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/issue/
#Returns all information for all versions
curl -D- -u uname:pass -X PUT -d "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/project/AN/versions?
#Returns all issues in a version
#This URL requires the version ID of a single version which is provided by the above query
curl -D- -u uname:pass -X PUT -d "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/search?jql=project="AN"+AND+fixVersion='12345'
@weshouman
weshouman / installing Jenkins.md
Last active May 4, 2021 12:20
installing Jenkins notes #jenkins

Installation

Preinstallation

  • Java jre and jdk should be installed.

Steps on ubuntu

wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
Host github.com
User git
HostName ssh.github.com
Port 443
ProxyCommand /usr/bin/connect -S socks.yourdomain.com:port %h %p
IdentityFile ~jenkins/.ssh/id_rsa
@vStone
vStone / list-git-branches.groovy
Created April 14, 2015 08:56
Jenkins groovy script which lists remote branches.
/*** BEGIN META {
"name": "List GIT Branches",
"comment": "You can use this to fill up a dynamic list parameter with branches. Optionally, you can filter the branches to show.",
"parameters": [ 'FILTER', 'REMOTE' ],
"core": "1.580",
"authors": [
{ name : "Jan Vansteenkiste" }
]
} END META**/
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@jaysoncena
jaysoncena / get-started-by-user.groovy
Created April 18, 2016 09:25
Jenkins - Get the user who triggered the current or the parent job
def triggeredBy = "---"
def iterateCause(b) {
upstreamcause = b.getCause(hudson.model.Cause.UpstreamCause.class)
if (upstreamcause != null) {
job = Jenkins.getInstance().getItemByFullName(upstreamcause.getUpstreamProject(), hudson.model.Job.class)
if (job != null) {
upstream = job.getBuildByNumber(upstreamcause.getUpstreamBuild())
if (upstream != null) {
iterateBuild(upstream)
@stuart-warren
stuart-warren / jenkins-docker-slaves.groovy
Last active June 20, 2021 16:26
Automatically configure the docker cloud in Jenkins (/var/lib/jenkins/init.groovy.d/jenkins-docker-slaves.groovy).
#!groovy
/*
Automatically configure the docker cloud in Jenkins.
Tested with:
- {name: 'docker-plugin', ver: '0.16.0'}
*/
import jenkins.model.*;
$files = Get-ChildItem "app*.config" -Recurse
$find = 'some-string-to-find'
$replace = 'some-string-to-replace-with'
Get-ChildItem $files -Recurse |
select -ExpandProperty fullname |
foreach {
If(Select-String -Path $_ -SimpleMatch $find -quiet){