Skip to content

Instantly share code, notes, and snippets.

@jvenkat255
jvenkat255 / Jenkinsfile
Created January 14, 2019 18:18 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@jvenkat255
jvenkat255 / Jenkinsfile
Created February 11, 2019 21:52
jenkinsfile and sonarqube
node {
echo "======================================="
echo "JENKINS_HOME = ${env.JENKINS_HOME}"
echo "JOB_NAME = ${env.JOB_NAME}"
echo "REPO_GIT = " + REPO_GIT
echo "DEFAULT_GIT_BRANCH = "+ DEFAULT_GIT_BRANCH
echo "SONAR_SERVER = "+ SONAR_SERVER
echo "======================================="
def sonarInstance=hudson.plugins.sonar.SonarInstallation.get(SONAR_SERVER).name;
@jvenkat255
jvenkat255 / README.md
Created April 26, 2019 16:28 — forked from mllrjb/README.md
Jenkins init.groovy.d role-based authorization strategy

Usage

Set a system environment variable AUTHZ_JSON_URL that points to a JSON file with the following structure:

{
  "admins": [
    "groupA", 
    "userA"
 ],
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sendgridAccountName": {
"type": "string",
"metadata": {
"description": "The name of your new SendGrid account."
}
},