This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Added to install the nginx-1.8 from the nginx repo. EPEL doesn't have any later than 1.0.15 at the time of this change | |
#And we need the nginx to support proxy_protocol & real_ip_recursive directives | |
yum_repository 'nginx' do | |
description "Nginx.org repo" | |
baseurl "http://nginx.org/packages/centos/6/$basearch/" | |
gpgcheck false | |
enabled true | |
action :create | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe 'yum' | |
include_recipe 'yum-epel' | |
include_recipe 'abc_jenkins::rubies' | |
include_recipe 'java' | |
include_recipe 'nginx' | |
include_recipe 'jenkins::master' | |
include_recipe 'abc_jenkins::chef_config' | |
include_recipe 'abc_jenkins::maven' | |
include_recipe 'abc_jenkins::git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def paths = ['some_path1', 'some_path2', 'another_path'] | |
def dirs = ['dir1', 'dir_for_some_path2', 'another_dir'] | |
[paths, dirs].transpose().each { path, dir -> | |
bat "xcopy %cd%${path}\\obj\\Lab5\\Package\\PackageTmp host1\\${dir} /E /Y /V" | |
bat "(robocopy %cd%${Path}${Another_fixed_path} ${Another_fixed_path}\\${dir} file1 file2) ^& IF %ERRORLEVEL% LEQ 7 exit 0" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch all of the remote branches and tags: | |
git fetch origin | |
# View all "old repo" local and remote branches: | |
git branch -a | |
# If some of the remotes/ branches doesn't have a local copy, | |
# checkout to create a local copy of the missing ones: | |
git checkout -b <branch> origin/<branch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>BlueKing</groupId> | |
<artifactId>BlueKing</artifactId> | |
<version>12.0.10-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is all of the escape sequences Ruby supports. You may not use many of these, but memorize their format and what they do anyway. Try them out in some strings to see if you can make them work. | |
Escape What it does. | |
\\ Backslash () | |
\' Single-quote (') | |
\" Double-quote (") | |
\a ASCII bell (BEL) | |
\b ASCII backspace (BS) | |
\f ASCII formfeed (FF) | |
\n ASCII linefeed (LF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Methods takes parameters as that of parameters in a script (ARGV) | |
def two_args(*argv) | |
a1, a2 = argv | |
puts "a1 = #{a1} & a2 = #{a2}" | |
end | |
puts two_args("one", "two") | |
============================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hudson.model.* | |
def jobsPerView(viewName) | |
{ | |
installView = jenkins.getView(viewName) | |
failedJobs_StatsJobs = installView.items.findAll{job -> job.isBuildable() && job.lastCompletedBuild && job.lastCompletedBuild.result == hudson.model.Result.FAILURE } | |
unstableJobs_StatsJobs = installView.items.findAll{job -> job.isBuildable() && job.lastCompletedBuild && job.lastCompletedBuild.result == hudson.model.Result.UNSTABLE } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# They both stores a block in a variable | |
#Differences: | |
1. Proc doesnt care the number of arguments passed | |
2. Proc exist out of a code block, when it meets 'return' while lambda processes return as moves on till 'end' | |
#Sample Proc | |
full_name = Proc.new {|first, last| first + " " + last} | |
p full_name["Jane", "Smith"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ternary Operators: | |
#1: | |
def s = "" | |
if (s != null && s.length() > 0) { | |
result = 'Found' | |
} | |
else { | |
result = 'Not Found' |
OlderNewer