-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathpacker-rg.json
107 lines (105 loc) · 2.38 KB
/
packer-rg.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
"variables": {
"vpcId": "",
"subnetId": "",
"awsProfile": "default",
"awsRegion": "",
"RG_HOME": "/opt/deploy/sp2",
"RG_SRC": "/home/ubuntu",
"amiName": "RG-AMI-1.21.0"
},
"builders": [
{
"type": "amazon-ebs",
"profile": "{{user `awsProfile`}}",
"iam_instance_profile": "packer-role1",
"region": "{{user `awsRegion`}}",
"vpc_id": "{{user `vpcId`}}",
"subnet_id": "{{user `subnetId`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.medium",
"ssh_username": "ubuntu",
"ami_name": "{{user `amiName`}}",
"associate_public_ip_address": "true"
}
],
"provisioners": [
{
"type": "file",
"source": "docker-compose.yml",
"destination": "{{user `RG_SRC`}}/"
},
{
"type": "file",
"source": "nginx.conf",
"destination": "{{user `RG_SRC`}}/"
},
{
"type": "file",
"source": "dump",
"destination": "{{user `RG_SRC`}}/"
},
{
"type": "shell",
"script": "./provisioners/provision-docker.sh"
},
{
"type": "shell",
"inline": [
"sudo apt install awscli -y"
]
},
{
"type": "shell",
"script": "./provisioners/provision-cfn-helper.sh"
},
{
"type": "shell",
"script": "./provisioners/provision-awscli.sh"
},
{
"type": "shell",
"script": "./provisioners/provision-ecr.sh"
},
{
"type": "file",
"source": "scripts",
"destination": "{{user `RG_SRC`}}/scripts"
},
{
"type": "file",
"source": "config",
"destination": "{{user `RG_SRC`}}/config"
},
{
"type": "shell",
"inline": [
"sudo apt install zip -y"
]
},
{
"type": "shell",
"environment_vars": ["RG_HOME=/opt/deploy/sp2","RG_SRC=/home/ubuntu"],
"script": "./provisioners/provision-rg.sh"
},
{
"type": "shell",
"script": "./provisioners/provision-mongo.sh",
"pause_before": "10s"
},
{
"type": "shell",
"inline": [
"sudo cp --recursive scripts /usr/local/sbin"
]
}
]
}