This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
go-server-packer.json
55 lines (55 loc) · 1.93 KB
/
go-server-packer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"variables": {
"gocd_version": "",
"instance_type": "c5.large",
"region": "{{env `REGION`}}",
"extra_ami_region_to_copy_to": "{{env `EXTRA_AMI_REGION_TO_COPY_TO`}}",
"openjdk_url": "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz",
"jre_path": "/usr/local/jre"
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `region`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "amzn-ami-hvm-*-x86_64-gp2",
"root-device-type": "ebs"
},
"owners": ["137112412989"],
"most_recent": true
},
"ami_groups": "all",
"ami_regions": ["{{user `extra_ami_region_to_copy_to`}}"],
"instance_type": "{{user `instance_type`}}",
"ssh_username": "ec2-user",
"ami_name": "GoCD Server {{user `gocd_version`}}",
"tags": {
"GoCD-Version": "{{user `gocd_version`}}",
"Name": "GoCD Server {{user `gocd_version`}}"
},
"snapshot_tags": {
"GoCD-Version": "{{user `gocd_version`}}",
"Name": "GoCD Server {{user `gocd_version`}}",
"Type": "server"
}
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo yum update -y",
"sudo yum install -y git mercurial subversion openssh-clients bash wget",
"sudo yum remove -y java-1.7.0-openjdk",
"sudo mkdir -p {{ user `jre_path` }} && wget {{ user `openjdk_url` }} -O java11.tar.gz && sudo tar -xf java11.tar.gz -C {{ user `jre_path` }} --strip 1 --exclude \"jdk*/lib/src.zip\" --exclude \"jdk*/include\" --exclude \"jdk*/jmods\"",
"echo 'PATH=$PATH:{{ user `jre_path` }}/bin' | sudo tee -a /etc/profile",
"sudo wget -q https://download.gocd.io/gocd.repo -O /etc/yum.repos.d/gocd.repo",
"sudo yum install -y go-server",
"sudo yum clean all",
"rm java11.tar.gz"
]
}
]
}