Skip to content

Instantly share code, notes, and snippets.

@yuvamanoj
yuvamanoj / Jenkinsfile
Created June 20, 2020 05:44 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@yuvamanoj
yuvamanoj / Jenkinsfile
Created June 20, 2020 05:44 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@yuvamanoj
yuvamanoj / Jenkinsfile
Created June 20, 2020 05:40 — forked from merikan/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@yuvamanoj
yuvamanoj / import.sh
Created June 20, 2020 05:30 — forked from merikan/import.sh
Migrate Maven artifacts from git repository to Nexus
#!/bin/bash
# Comments by Peter Merikan:
#
# This script is based on Steven Wheeler excellent script
# see https://www.steventwheeler.com/java/2018/10/30/migrate-artifactory-to-nexus.html
#
# Notes:
# 1. This script does not work on Macos, use Linux
@yuvamanoj
yuvamanoj / Jenkinsfile
Created June 20, 2020 05:22 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples