-
Notifications
You must be signed in to change notification settings - Fork 0
/
buckets.py
45 lines (35 loc) · 1.46 KB
/
buckets.py
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
import boto3
import json
from chalicelib_fourfront.vars import FOURSIGHT_PREFIX
from foursight_core.buckets import Buckets as Buckets_from_core
from dcicutils import env_utils
class Buckets(Buckets_from_core):
"""create and configure buckets for foursight"""
prefix = FOURSIGHT_PREFIX
envs = ['data', 'hotseat', 'mastertest', 'staging', 'webdev']
def ff_env(self, env):
if env_utils.is_stg_or_prd_env(env): # data or staging
return env
else:
return 'fourfront-%s' % env
def ff_url(self, env):
if env == 'data':
return 'https://data.4dnucleome.org/'
elif env == 'staging':
return 'https://staging.4dnucleome.org/'
else:
return 'http://%s.9wzadzju3p.us-east-1.elasticbeanstalk.com/' % self.ff_env(env)
def es_url(self, env):
# WARNING: the es url of data and staging may be swapped depending on which state it is currently.
if env == 'data':
return "https://search-fourfront-blue-6-8-cghd4hoobl45t6cmvku4xc4y4i.us-east-1.es.amazonaws.com"
if env == 'staging':
return "search-fourfront-green-6-8-qfcturjlmonunnuqzyxxsvnmbu.us-east-1.es.amazonaws.com"
else:
return "https://search-fourfront-testing-6-8-kncqa2za2r43563rkcmsvgn2fq.us-east-1.es.amazonaws.com"
def main():
buckets = Buckets()
buckets.create_buckets()
buckets.configure_env_bucket()
if __name__ == '__main__':
main()