#!/usr/bin/env python3 # this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project import sys import os sys.path.insert(0, os.path.expanduser("~/bin/")) os.chdir(os.path.expanduser("~/smc-cluster-mgmt")) # host of statistics project from smc_rethinkdb import project_host host = project_host("7561f68d-3d97-4530-b97e-68af2fb4ed13") src = os.path.expanduser("~/stripe/") # push to the project via ansible and set the permissions os.system( 'ansible %s -m copy -a "src=%s dest=/projects/7561f68d-3d97-4530-b97e-68af2fb4ed13/stripe/ owner=1078872008 group=1078872008 mode=u=rw,go=" -become' % (host, src) )
#!/usr/bin/env python3 # this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project import sys import os sys.path.insert(0, os.path.expanduser("~/bin/")) os.chdir(os.path.join(os.environ['SMC_ROOT'], "smc-build/smc-ansible")) # host of statistics project from smc_rethinkdb import project_host host = project_host("7561f68d-3d97-4530-b97e-68af2fb4ed13") src = os.path.expanduser("~/stripe/") # push to the project via ansible and set the permissions os.system( 'ansible %s -m copy -a "src=%s dest=/projects/7561f68d-3d97-4530-b97e-68af2fb4ed13/stripe/ owner=1078872008 group=1078872008 mode=u=rw,go=" -become' % (host, src))
#!/usr/bin/env python3 import sys import os sys.path.insert(0, os.path.expanduser("~/bin/")) os.chdir(os.path.join(os.environ['SMC_ROOT'], "smc-build/smc-ansible")) from smc_rethinkdb import export_accounts, project_host export_accounts("accounts.yaml.bz2") host = project_host("92848d19-8432-46c8-ba59-2b0d9521c9f2") # push to the project via ansible and set the permissions os.system( 'ansible %s -m copy -a "src=accounts.yaml.bz2 dest=/projects/92848d19-8432-46c8-ba59-2b0d9521c9f2/marketing/cold-emails/ owner=751223180 group=751223180 mode=u=rw,go=" -become' % host) os.system("rm -f accounts.yaml.bz2")
# this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project print("setup") import sys import os from os.path import join, expanduser, relpath, normpath # Id of the smc statistics project project_id = '7561f68d-3d97-4530-b97e-68af2fb4ed13' sys.path.insert(0, expanduser("~/bin/")) os.chdir(expanduser("~/smc-cluster-mgmt")) # host of statistics project print("get host") from smc_rethinkdb import project_host host = project_host(project_id) print("host = ", host) db_logs = expanduser("~/db-logs/") # push to the project via ansible and set the permissions print("run ansible") from glob import glob for root, dirs, files in os.walk(db_logs): for fn in files: fn = join(relpath(root, db_logs), fn) dest = normpath(join('/projects/%s/db-logs/' % project_id, fn)) src = normpath(join(db_logs, fn)) print('src=%s' % src)
# this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project print("setup") import sys import os from os.path import join, expanduser, relpath, normpath # Id of the smc statistics project project_id = '7561f68d-3d97-4530-b97e-68af2fb4ed13' sys.path.insert(0, expanduser("~/bin/")) os.chdir(os.path.join(os.environ['SMC_ROOT'], "smc-build/smc-ansible")) # host of statistics project print("get host") from smc_rethinkdb import project_host host = project_host(project_id) print("host = ", host) db_logs = expanduser("~/db-logs/") # push to the project via ansible and set the permissions print("run ansible") from glob import glob for root, dirs, files in os.walk(db_logs): for fn in files: fn = join(relpath(root, db_logs), fn) dest = normpath(join('/projects/%s/db-logs/' % project_id, fn)) src = normpath(join(db_logs, fn)) print('src=%s' % src)
#!/usr/bin/env python3 import sys import os sys.path.insert(0, os.path.expanduser("~/bin/")) os.chdir(os.path.expanduser("~/smc-cluster-mgmt")) from smc_rethinkdb import export_accounts, project_host export_accounts("accounts.yaml.bz2") host = project_host("92848d19-8432-46c8-ba59-2b0d9521c9f2") # push to the project via ansible and set the permissions os.system('ansible %s -m copy -a "src=accounts.yaml.bz2 dest=/projects/92848d19-8432-46c8-ba59-2b0d9521c9f2/marketing/cold-emails/ owner=751223180 group=751223180 mode=u=rw,go=" -become' % host) os.system("rm -f accounts.yaml.bz2")