Пример #1
0
    def __init__(self, host_name, aws_conf, gtfs_conf=None, oba_conf=None):
        AmazonLinuxFab.__init__(self, aws_conf, host_name)
        self.aws_conf = aws_conf
        self.gtfs_conf = gtfs_conf
        self.oba_conf = oba_conf

        self.data_dir = unix_path_join('/home', self.user, 'data')
        self.bundle_dir = unix_path_join(self.data_dir, 'bundle')
        self.script_dir = unix_path_join('/home', self.user, 'scripts')
        self.config_dir = unix_path_join('/home', self.user, 'conf')

        if oba_conf:
            self.oba_base_folder = oba_conf.get('oba_base_folder')
Пример #2
0
 def test_amazon_linux_stuff(self):
     
     amzn_linux_fab = AmazonLinuxFab(self.ec2_conf, self.ec2_instance.public_dns_name)
     amzn_linux_fab.set_timezone('/usr/share/zoneinfo/America/Los_Angeles')
     amzn_linux_fab.update_system()
     amzn_linux_fab.install_custom_monitoring()
     amzn_linux_fab.install_git()
     amzn_linux_fab.install_jdk()
     amzn_linux_fab.install_maven()
     amzn_linux_fab.install_node()
     
     # pg setup
     init_sql_filename = 'init_test_db.sql'
     init_sql_path = os.path.join(TEMPLATE_DIR, init_sql_filename)
     amzn_linux_fab.install_pg(init_sql_path, init_sql_filename)
Пример #3
0
def amazon_linux_test_battery():
    
    # create config helper
    ConfHelper = ConfigHelper(CONFIG_DIR, TEMPLATE_DIR) 
        
    # launch ec2
    ec2_conf = ConfHelper.get_config('test_amazon_linux')
    ec2_instance, ec2_connection = launch_new_ec2(ec2_conf, True)
    
    # do fab stuff to ec2 instance
    amzn_linux_fab = AmazonLinuxFab(ec2_conf, ec2_instance.public_dns_name)
    amzn_linux_fab.set_timezone('/usr/share/zoneinfo/America/Los_Angeles')
    amzn_linux_fab.update_system()
    amzn_linux_fab.install_custom_monitoring()
    amzn_linux_fab.install_git()
    amzn_linux_fab.install_jdk()
    amzn_linux_fab.install_maven()
    amzn_linux_fab.install_node()
    
    # pg setup
    init_sql_filename = 'init_test_db.sql'
    init_sql_path = os.path.join(TEMPLATE_DIR, init_sql_filename)
    amzn_linux_fab.install_pg(init_sql_path, init_sql_filename)

    # Terminate EC2 instance.
    tear_down(ec2_instance.id, ec2_connection)