def work(): image = get_image_name("montagu-api-blackbox-tests", versions.api) pull(image) run([ "docker", "run", "--rm", "--network", "montagu_default", "-v", "montagu_emails:/tmp/montagu_emails", image ], check=True)
def migrate_schema_core(service, root_password): network_name = service.network_name print("- migrating schema") image = "vimc/{name}:{version}".format(name="montagu-migrate", version=versions.db) pull(image) cmd = ["docker", "run", "--rm", "--network=" + network_name, image] + \ ["-user=vimc", "-password="******"migrate"] run(cmd, check=True)
def run_suite(portal, version): image = "vimc/montagu-portal-integration-tests:{version}".format( version=version) pull(image) run( [ "docker", "run", "--rm", "--network", "montagu_default", "-v", "/opt/teamcity-agent/.docker/config.json:/root/.docker/config.json", "-v", "/var/run/docker.sock:/var/run/docker.sock", image, portal.title() # Tests expect capitalized first letter, e.g. "Admin" ], check=True)
def cli(command): image = get_image_name("orderly-web-user-cli", "master") pull(image) result = run([ "docker", "run", "--rm", "-v", "montagu_orderly_volume:/orderly", "--network", "montagu_default", image ] + command, stderr=PIPE, stdout=PIPE) print(result.stderr) print(result.stdout) if result.returncode > 0: print(result.args) print("Warning: failed to execute command")
def work(): cwd = os.getcwd() run(["docker", "volume", "create", "orderly_volume"], check=True) orderly_image = get_image_name("orderly.server", "master") pull(orderly_image) run([ "docker", "run", "-d", "-p", "8321:8321", "--network", "montagu_default", "-v", "orderly_volume:/orderly", "-w", "/orderly", "--name", "montagu_orderly_orderly_1", orderly_image, "--port", "8321", "--go-signal", "/go_signal", "/orderly" ], check=True) run([ "docker", "exec", "montagu_orderly_orderly_1", "Rscript", "-e", "orderly:::create_orderly_demo('/orderly')" ], check=True) run([ "docker", "exec", "montagu_orderly_orderly_1", "orderly", "rebuild", "--if-schema-changed" ], check=True) run([ "docker", "exec", "montagu_orderly_orderly_1", "touch", "/go_signal" ], check=True) ow_image = get_image_name("orderly-web", "master") pull(ow_image) run([ "docker", "run", "-d", "-p", "8888:8888", "--network", "montagu_default", "-v", "orderly_volume:/orderly", "-v", cwd + "/container_config/orderlyweb:/etc/orderly/web", "--name", "montagu_orderly_web_1", ow_image ], check=True) run([ "docker", "exec", "montagu_orderly_web_1", "touch", "/etc/orderly/web/go_signal" ], check=True) ow_migrate_image = get_image_name("orderlyweb-migrate", "master") pull(ow_migrate_image) run([ "docker", "run", "--rm", "-v", "orderly_volume:/orderly", ow_migrate_image ], check=True) ow_cli_image = get_image_name("orderly-web-user-cli", "master") pull(ow_cli_image) # user for api blackbox tests add_user("*****@*****.**", ow_cli_image) grant_permissions("*****@*****.**", ow_cli_image, ["*/users.manage"]) # add task q user add_user("*****@*****.**", ow_cli_image) grant_permissions( "*****@*****.**", ow_cli_image, ["*/reports.run", "*/reports.review", "*/reports.read"]) # user for webapp tests add_user("*****@*****.**", ow_cli_image) grant_permissions("*****@*****.**", ow_cli_image, ["*/users.manage"])