forked from martinrusev/amon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.py
More file actions
72 lines (53 loc) · 1.97 KB
/
Copy pathdeploy.py
File metadata and controls
72 lines (53 loc) · 1.97 KB
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
from keys import key, secret
import os
path = os.path.dirname(os.path.abspath(__file__))
version = "0.9"
from boto.s3.key import Key
from boto.s3.connection import S3Connection
conn = S3Connection(key, secret)
uninstall_bucket = conn.get_bucket('uninstall.amon.cx')
install_bucket = conn.get_bucket('install.amon.cx')
contrib_bucket = conn.get_bucket('config.amon.cx')
k = Key(uninstall_bucket)
distros = ['macos']
uninstallers = list(distros)
uninstallers.append('uninstaller')
for u in uninstallers:
k.key = u
full_path = "{0}/uninstallers/{1}".format(path, u)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
k = Key(install_bucket)
installers = list(distros)
installers.append('installer')
for i in installers:
k.key = i
full_path = "{0}/installers/{1}".format(path, i)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
# Deploy contrib files
k = Key(contrib_bucket)
for distro in distros:
if distro != 'macos':
file = 'mongodb'
k.key = "{0}/{1}".format(distro, file)
full_path = "{0}/contrib/mongodb/{1}/{2}".format(path, distro, file)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
# Deploy single files
k.key = 'mongodb.conf'
full_path = "{0}/contrib/mongodb/mongodb.conf".format(path)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
k.key = 'amon'
full_path = "{0}/contrib/amon/amon".format(path)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
k.key = 'amond'
full_path = "{0}/contrib/amon/amond".format(path)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()
k.key = 'amon.conf'
full_path = "{0}/config/amon.conf".format(path)
k.set_contents_from_filename(full_path, headers={'Content-Type': 'text/plain'} )
k.make_public()