forked from heroiclabs/nakama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarketplace-image.json
96 lines (96 loc) · 2.39 KB
/
marketplace-image.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": {
"token": "{{env `DIGITALOCEAN_API_TOKEN`}}",
"image_name": "marketplace-snapshot-{{timestamp}}",
"nakama_url": "https://github.com/heroiclabs/nakama/releases/download/v2.6.0/nakama-2.6.0-linux-amd64.tar.gz",
"cockroach_url": "https://binaries.cockroachdb.com/cockroach-v19.1.3.linux-amd64.tgz"
},
"builders": [
{
"type": "digitalocean",
"api_token": "{{user `token`}}",
"image": "ubuntu-18-04-x64",
"region": "nyc3",
"size": "s-1vcpu-1gb",
"ssh_username": "root",
"snapshot_name": "{{user `image_name`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sleep 30"
]
},
{
"type": "file",
"source": "files/etc/",
"destination": "/etc"
},
{
"type": "file",
"source": "files/var/",
"destination": "/var"
},
{
"type": "shell",
"inline": [
"echo 'setting file permissions'",
"chmod 644 /etc/systemd/system/nakama.service",
"chmod +x /etc/update-motd.d/99-one-click",
"chmod +x /var/lib/cloud/scripts/per-instance/001_onboot"
]
},
{
"type": "shell",
"inline": [
"apt-get -qqy update",
"apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' upgrade",
"apt-get -qqy dist-upgrade"
]
},
{
"type": "shell",
"environment_vars": [
"nakamaurl={{user `nakama_url`}}",
"cockroachurl={{user `cockroach_url`}}"
],
"inline": [
"wget -qO- $nakamaurl | tar xvz ",
"wget -qO- $cockroachurl | tar xvz --strip-components=1",
"mv -i cockroach /usr/local/bin",
"mv -i nakama /usr/local/bin",
"systemctl enable nakama"
]
},
{
"type": "shell",
"inline": [
"cockroach start --background --insecure --store=path='/root/cdb-store1/' --listen-addr=localhost",
"nakama migrate up",
"cockroach quit --insecure"
]
},
{
"type": "shell",
"inline": [
"mkdir -p ~/nakama",
"mkdir -p ~/nakama/data"
]
},
{
"type": "file",
"source": "files/nakama/",
"destination": "~/nakama/"
},
{
"type": "shell",
"scripts": [
"scripts/01-test",
"scripts/90-cleanup.sh",
"scripts/99-img_check.sh"
]
}
]
}