This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.json
96 lines (96 loc) · 2.83 KB
/
template.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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"rds_host": "",
"rds_password": "",
"build_env": "",
"ami_name": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-west-2",
"source_ami": "ami-d2c924b2",
"instance_type": "t2.medium",
"ssh_username": "centos",
"ami_name": "{{user `ami_name`}}-{{user `build_env`}} {{timestamp}}",
"ssh_private_ip": false,
"associate_public_ip_address": true,
"ssh_pty" : true,
"security_group_id": "sg-dff3bcb9"
}],
"provisioners": [{
"type": "shell",
"inline": [
"mkdir /tmp/app"
]
},{
"type": "file",
"source": "./config",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./deploy",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./server",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./gulpfile.babel.js",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./.istanbul.yml",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./.snyk",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./.yarnrc",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./index.js",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./package.json",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./yarn.lock",
"destination": "/tmp/app/"
},{
"type": "file",
"source": "./stress_test.py",
"destination": "/home/centos/"
},{
"type": "shell",
"inline": [
"sleep 30",
"sudo yum -y install epel-release",
"sudo yum -y install ansible git",
"sudo yum -y install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64 unzip",
"sudo yum clean all"
]
},{
"type": "ansible-local",
"playbook_file": "./deploy/playbook.yml",
"role_paths": [
"./deploy/roles/nodejs",
"./deploy/roles/api",
"./deploy/roles/repo-epel",
"./deploy/roles/logging",
"./deploy/roles/cloudwatch",
"./deploy/roles/cron",
"./deploy/roles/nginx"
],
"extra_arguments": "-vv --extra-vars \"messaging_service_pg_db={{user `messaging_service_pg_db`}} messaging_service_pg_host={{user `messaging_service_pg_host`}} messaging_service_pg_password={{user `messaging_service_pg_password`}} messaging_service_pg_user={{user `messaging_service_pg_user`}} node_env={{user `build_env`}} messaging_service_port={{user `messaging_service_port`}} jwt_secret={{user `jwt_secret`}} service_name={{user `service_name`}} logstash_host={{user `logstash_host`}}\""
}]
}