summaryrefslogtreecommitdiff
path: root/frontend/packer_template.json
blob: 79e398a24866acb613e41cdaba412053321650d8 (plain)
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
{
    "builders": [
        {
            "name": "development",
            "type": "docker",
            "image": "fedora:20",
            "commit": true,
            "run_command": ["-d", "-i", "-t", "{{.Image}}", "/bin/sh"]
        },
        {
            "name": "production",
            "type": "openstack",
            "image_name": "frontend-haproxy",
            "flavor": 2,
            "source_image": "742e0414-c985-4994-b307-4aafade942b3",
            "networks": ["d079fa3e-2558-4bcb-ad5a-279040c202b5"],
            "floating_ip": "85.199.252.162",
            "use_floating_ip": true,
            "ssh_username": "fedora"
        }
    ],
    "provisioners": [
        {
            "type": "file",
            "source": "frontend/haproxy.cfg",
            "destination": "/var/tmp/haproxy.cfg"
        },
        {
            "type": "shell",
            "inline": [
                "sudo yum install -y haproxy nc",
                "sudo mv /var/tmp/haproxy.cfg /etc/haproxy/haproxy.cfg",
                "sudo mkdir /var/log/journal"
            ]
        },
        {
            "type": "shell",
            "inline": [
                "sudo systemctl enable haproxy.service",
                "sudo systemctl start haproxy.service"
            ],
            "only": ["production"]
        },
        {
            "type": "shell",
            "inline": [ "sync; sync; sleep 10; sync" ],
            "only": ["production"]
        }
    ],
    "post-processors": [
        [
            {
                "type": "docker-tag",
                "repository": "baserock/frontend",
                "tag": "latest",
                "only": ["development"]
            }
        ]
    ]
}