Skip to content

Instantly share code, notes, and snippets.

@idletekz
idletekz / links.md
Created October 25, 2016 18:21 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course
@idletekz
idletekz / gist:8b83a15b9052c607eedc0eb6d92e82a4
Created December 23, 2016 15:06 — forked from mikepfeiffer/gist:4d9386afdcceaf29493a
EC2 UserData script to install CodeDeploy agent
#!/bin/bash
yum install -y aws-cli
cd /home/ec2-user/
aws s3 cp 's3://aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm' . --region us-east-1
yum -y install codedeploy-agent.noarch.rpm
@idletekz
idletekz / gist:6f43991453f7b8d27fcd506befaf6f27
Created January 2, 2017 05:21 — forked from mikepfeiffer/gist:6f9e6cac7607fc365874cd7d31dbb141
Example to Create AWS ELB, Launch Config, and Auto Scaling Group
aws elb create-load-balancer \
--load-balancer-name MyELB \
--listeners Protocol=TCP,LoadBalancerPort=80,InstanceProtocol=TCP,InstancePort=80 \
--subnets subnet-46e6506c subnet-57b8010f \
--scheme internet-facing \
--security-groups sg-aec570d4
aws autoscaling create-launch-configuration \
--launch-configuration-name MyLC \
--key-name virginia \
@idletekz
idletekz / README.md
Created March 6, 2017 03:27 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@idletekz
idletekz / fileCopy.groovy
Created April 19, 2017 13:19 — forked from osima/fileCopy.groovy
binary file copy example in groovy
copy = { File src,File dest->
def input = src.newDataInputStream()
def output = dest.newDataOutputStream()
output << input
input.close()
output.close()
}
@idletekz
idletekz / jsonPrettyPrint.groovy
Created April 24, 2017 20:07 — forked from osima/jsonPrettyPrint.groovy
json pretty print using groovy
json = '{"twitter":"@osima.jp","web site":["http://osima.jp/","http://www.my-notebook.net/"]}'
println groovy.json.JsonOutput.prettyPrint(json)
@idletekz
idletekz / jenkins-build-flow-external.groovy
Created April 25, 2017 17:43 — forked from pokle/jenkins-build-flow-external.groovy
How to run an external script from source control in the Jenkins Build Flow plugin DSL
//
// Copy this into your Jenkins Build Flow plugin DSL, and call run_workspace_script() with the name of your checked in script
//
// Based on code at http://jorgemanrubia.net/2009/10/10/evaluating-code-dynamically-in-groovy
//
def run_workspace_script(filename) {
def code = new File(build.workspace.child(filename).toString()).text
def code_as_closure = "{->${code}}"
def closure = evaluate(code_as_closure)
closure.delegate=this
Jenkins.instance.getItemByFullName("project name").updateNextBuildNumber(13)
<project>
...
<build>
<!-- To define the plugin version in your parent POM -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
@idletekz
idletekz / francois.email.groovy.template
Created July 19, 2017 17:50 — forked from francoisledroff/francois.email.groovy.template
A groovy template to send fancy html formatted emails through the jenkins email extension plugins. the associated email extension plugin is https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin One way to debug it is to use a groovy script through the jenkins script menu (http://localhost:8080/jenkins/script) cf. https://gist.github.com/f…
<!DOCTYPE html>
<head>
<title>Build report</title>
<style type="text/css">
body
{
margin: 0px;
padding: 15px;
}