Skip to content

Instantly share code, notes, and snippets.

Rafael M. Pestano rmpestano

Block or report user

Report or block rmpestano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rmpestano
rmpestano / Jenkinsfile.adoc
Last active Apr 23, 2019
Java maven jenkinsfile
View Jenkinsfile.adoc
pipeline {
    agent any
    tools {
        maven 'apache-maven-3.3.9'
        jdk 'jdk1.8'
    }
    stages {
        stage('Build') {
            steps {
View remove accents.adoc
private String removeAccents(String str) {
        return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
    }
View gist:8ca08cc5c99c0016fe1bb330e461d6b7
kubectl patch deployment cdi-crud -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
View install-minikube.sh
#!/bin/sh
sudo curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& sudo chmod +x minikube && sudo cp minikube /usr/local/bin && rm minikube && minikube version
@rmpestano
rmpestano / gist:1373c09242778926b4e5384e986696fd
Created Jan 7, 2019
Configure Docker on ubuntu under corporate proxy
View gist:1373c09242778926b4e5384e986696fd
== Install
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --keyserver-options http-proxy=localhost:3128 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-get install docker-ce
== Proxy config
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo gedit /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
@rmpestano
rmpestano / jenkinsfile.adoc
Last active Nov 12, 2018
input+when condition in a declarative pipeline
View jenkinsfile.adoc
pipeline {
    agent none

    //other stages

    stage("Stage ok") {
        agent any
           when {
	      expression {
View netbeans-setup.adoc
  1. Change auto popup config at Tools → Options → Editor → Code completion
    DYbPd0jWAAAimP2

  2. Install autosave plugin;

  3. Enable terminal at Window → IDE tools → terminal;

  4. Install git toolbar;

  5. Install Dracula theme;

  6. Adjust identation at Tools → Options → Editor → Formatting
    3M6Aqv2

@rmpestano
rmpestano / sendEmail.groovy
Last active Apr 12, 2018
sendMail jenkins shared library
View sendEmail.groovy
#!/usr/bin/env groovy
/**
* This shared lib depends on emailExt plugin
* Usage:
post { //after build
changed { //if status changed then send email
sendEmail('dest1@mail.com, dest2@mail.com')
}
@rmpestano
rmpestano / qualityGates.groovy
Last active Apr 12, 2018
Jenkins Sonar quality gates integration via shared library
View qualityGates.groovy
#!/usr/bin/env groovy
/**
* Fails the pipeline if project quality doesn't meet the configured quality profile (see https://docs.sonarqube.org/display/SONAR/Quality+Gates AND https://docs.sonarqube.org/display/SONAR/Quality+Profiles).
* This DSL function must be invoked after the quality analisys has been published. Example:
*
* stage('sonar') {
* steps {
* withSonarQubeEnv('sonar') { //there must be a tool named 'sonar' configured on Jenkins (/jenkins/configureTools)
* sh 'mvn sonar:sonar' //publish project quality on sonar
@rmpestano
rmpestano / arquillian-detect-mode.adoc
Last active Aug 8, 2017
Arquillian detect run mode
View arquillian-detect-mode.adoc
<plugin>
          <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <systemPropertyVariables>
                        <arquillianContainer>${arquillian.container}</arquillianContainer>
                    </systemPropertyVariables>
                </configuration>
You can’t perform that action at this time.