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
{ | |
"builders": [ | |
{ | |
"ami_description": "{{user `ami-description`}}", | |
"ami_name": "{{user `ami-name`}}", | |
"ami_regions": [ | |
"us-east-1" | |
], | |
"ami_users": [ | |
"XXXXXXXXXX" |
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
# Security Group: | |
resource "aws_security_group" "jenkins_server" { | |
name = "jenkins_server" | |
description = "Jenkins Server: created by Terraform for [dev]" | |
# legacy name of VPC ID | |
vpc_id = "${data.aws_vpc.default_vpc.id}" | |
tags { | |
Name = "jenkins_server" |
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/bash | |
set -x | |
# For Node | |
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - | |
# For xmlstarlet | |
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
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
# AMI lookup for this Jenkins Server | |
data "aws_ami" "jenkins_server" { | |
most_recent = true | |
owners = ["self"] | |
filter { | |
name = "name" | |
values = ["amazon-linux-for-jenkins*"] | |
} | |
} |
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/bash | |
set -x | |
function wait_for_jenkins() | |
{ | |
while (( 1 )); do | |
echo "waiting for Jenkins to launch on port [8080] ..." | |
nc -zv 127.0.0.1 8080 |
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
resource "aws_security_group" "dev_jenkins_worker_linux" { | |
name = "dev_jenkins_worker_linux" | |
description = "Jenkins Server: created by Terraform for [dev]" | |
# legacy name of VPC ID | |
vpc_id = "${data.aws_vpc.default_vpc.id}" | |
tags { | |
Name = "dev_jenkins_worker_linux" | |
env = "dev" |
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
data "aws_ami" "jenkins_worker_linux" { | |
most_recent = true | |
owners = ["self"] | |
filter { | |
name = "name" | |
values = ["amazon-linux-for-jenkins*"] | |
} | |
} |
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
<powershell> | |
write-output "Running User Data Script" | |
write-host "(host) Running User Data Script" | |
Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction Ignore | |
# Don't set this before Set-ExecutionPolicy as it throws an error | |
$ErrorActionPreference = "stop" |
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
{ | |
"variables": { | |
"ami-description": "Windows Server for Jenkins Slave ({{isotime \"2006-01-02-15-04-05\"}})", | |
"ami-name": "windows-slave-for-jenkins-{{isotime \"2006-01-02-15-04-05\"}}", | |
"aws_access_key": "", | |
"aws_secret_key": "" | |
}, | |
"builders": [ | |
{ |
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
# Setting Up machine for Jenkins | |
#Jenkins root directory | |
$jenkins_slave_path = "C:\Jenkins" | |
If(!(test-path $jenkins_slave_path)) | |
{ | |
New-Item -ItemType Directory -Force -Path $jenkins_slave_path | |
} | |
# Install Chocolatey for managing installations |
OlderNewer