-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarketplace-image.json
59 lines (59 loc) · 1.83 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
{
"variables": {
"token": "{{env `DIGITALOCEAN_TOKEN`}}",
"rethinkdb_version": "{{env `RETHINKDB_VERSION`}}",
"image_id": "{{env `IMAGE_ID`}}",
"image_name": "marketplace-snapshot-{{env `RETHINKDB_VERSION`}}-{{timestamp}}",
"apt_packages": "rethinkdb={{user `rethinkdb_version`}}"
},
"builders": [
{
"type": "digitalocean",
"api_token": "{{user `token`}}",
"image": "{{user `image_id`}}",
"region": "nyc3",
"size": "s-1vcpu-1gb",
"ssh_username": "root",
"snapshot_name": "{{user `image_name`}}"
}
],
"provisioners": [
{
"type": "file",
"source": "files/etc/",
"destination": "/etc/"
},
{
"type": "file",
"source": "files/var/",
"destination": "/var/"
},
{
"type": "shell",
"scripts": [
"scripts/01-setup.sh",
"scripts/02-firewall.sh"
]
},
{
"type": "shell",
"inline": [
"cloud-init status --wait",
"apt-get -qqy update",
"apt-get install -y apt-transport-https ca-certificates",
"apt-key adv --keyserver keyserver.ubuntu.com --recv-keys '539A3A8C6692E6E3F69B3FE81D85E93F801BB43F'",
"add-apt-repository \"deb https://download.rethinkdb.com/repository/ubuntu-$(lsb_release -cs) $(lsb_release -cs) main\"",
"apt-get -qqy update",
"apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' full-upgrade",
"apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install {{user `apt_packages`}}"
]
},
{
"type": "shell",
"scripts": [
"scripts/90-cleanup.sh",
"scripts/99-img_check.sh"
]
}
]
}