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
#!/bin/sh | |
groupadd --gid 500 ec2-user | |
useradd --gid 500 --uid 500 ec2-user | |
mkdir /data && chown ec2-user:ec2-user /data | |
mkdir /etc/sudoers.d/ | |
echo "ec2-user ALL=(ALL) NOPASSWD: ALL">/etc/sudoers.d/ec2-user |
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
Gopal Nallamilli Salary | |
April 2018: $12.00 ($10.00 Salary + $2.00 bonus) | |
May 2018 : $12.00 ($10.00 Salary + $2.00 bonus) | |
Total Sal: $24.00 |
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
Jenkins.instance.getTrigger("SCMTrigger").getRunners().each() | |
{ | |
item -> | |
long millis = Calendar.instance.time.time - item.getStartTime() | |
if(millis > (1000 * 60 * 60)) // 1000 millis in a second * 60 seconds in a minute * 3 minutes | |
{ | |
Thread.getAllStackTraces().keySet().each() | |
{ | |
tItem -> |
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.* | |
disableChildren(Hudson.instance.items) | |
def disableChildren(items) { | |
def daysToKeep = 14 | |
def numToKeep = 10 | |
def artifactDaysToKeep = -1 | |
def artifactNumToKeep = -1 |
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
git config --global core.sshCommand 'ssh -i /home/ec2-user/.ssh/id_rsa_stage' |
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
create_cachefs() { | |
echo "${FUNCNAME[0]}" | |
BLOCK_DEVICE='/dev/nvme0n1' | |
NVME_CACHE_MOUNT_POINT='/cache-fs' | |
SERVICE_USER_NAME='tooladmin' | |
# Only set this up if we have an nvme ephemeral | |
if [[ ! -e ${BLOCK_DEVICE} ]] ; then | |
echo "FAILURE: Service needs a specific amazon instance type" |
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
Jenkins.instance.pluginManager.plugins.sort { it.getDisplayName() }.each{ | |
plugin -> | |
println ("(${plugin.getShortName()}): ${plugin.getVersion()}") | |
} |
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
cat 004-HarFile.har | jq '[.log.entries[] | {time: .time, url: .request.url}]' | jq 'sort_by(.time)' > requestTime.json |
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
1) Need below plugins for shared agents to work | |
Operations Center OpenID Cluster Session Extension | |
Operations Center Cloud | |
CloudBees SSH Build Agents Plugin | |
2) |
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
Safe alternative: use the host Docker daemon from within a container | |
The simple solution to allow a container process to start another container is to share the Docker socket of the host with the container, doing something like this: | |
docker run -v /var/run/docker.sock:/var/run/docker.sock -d --name some_container some_image | |
Assuming that Docker is installed in the image invoked, then the Docker client run within that container will be communicating with the Docker daemon running on the host. | |
Any containers created from within some_container would actually be created by the same Docker daemon that created some_container itself. Those new containers would be sibling containers, siblings to some_container. | |
Now there should be no worries about data corruption from nested storage drivers, or shared access to the Docker image cache. |