def check_parent_directory(domain_code): if File.exists(path_base + domain_code): print('directory exists') else: print('directory doesnt exist')
#tmp hack for testing #File.delete_folder(path_base+domain_obj.domain_code+'/') File.force_folder_existance(path_base + domain_obj.domain_code + '/') env = 'dev' #todo - need to move the to a config file git_obj = Git(domain_obj.domain_code, env) git_obj.run_wizard() # create file for nginx #output = UI.run('whoami') #print(output) #todo figure out this permission issue - folder is currently set to 777 as a temp workaround #todo - when chaning port # it does not seem to overwrite sites_available_file = '/etc/nginx/sites-available/{}'.format( domain_obj.domain_code) if not File.exists(sites_available_file): File.force_existance(sites_available_file) text = ''' server {{ listen 80; server_name {domain} www.{domain}; access_log /home/ubuntu/logs/nginx_access.log; location /static/ {{ alias /home/ubuntu/{domain_code}/staticfiles/; }} location / {{ proxy_pass http://127.0.0.1:{port}; proxy_set_header Host $server_name;