shell.runshell([casa_full_dir + "/bin/python3", "-m","pytest", work_dir + "/pipeline", '--junitxml=' + work_dir + '/pipeline_test_result.xml'], work_dir + "/pipeline", env)
from shell_runner import ShellRunner
parser=argparse.ArgumentParser()
parser.add_argument('-p','--casapkg', help='Tarball or .dmg', required=True)
parser.add_argument('-t','--target', help='Target branch e.g. master', required=True)
parser.add_argument('-w','--workdir', help='Working directory', required=True)
parser.add_argument('-s','--sourcebranch', help='Source branch e.g. pipe-123', required=True)
args = parser.parse_args()
pipeline_repo="https://open-bitbucket.nrao.edu/scm/pipe/pipeline.git"
script_dir = os.path.dirname(os.path.abspath(__file__))
print("Casa package: " + casa_pkg)
print("Platform: " + platform.system())
if (platform.system()=="Linux"):
cmd = ('cp ' + casa_pkg + " " + work_dir)
shell.runshell(cmd.split(), work_dir)
cmd = ('tar xvf ' + casa_pkg )
rc = shell.runshell(cmd.split(), work_dir)
raise Exception("Couldn't extract tarball")
cmd = ('git clone ' + pipeline_repo)
shell.runshell(cmd.split(), work_dir)
cmd = ('git config --global user.name "bamboo"')
rc = shell.runshell(cmd.split(), work_dir + "/pipeline")
raise Exception("Failed to set name.")
cmd = ('git config --global user.email "bamboo_merge@.nrao.edu"')
rc = shell.runshell(cmd.split(), work_dir + "/pipeline")
raise Exception("Failed to set email")
cmd = ('git checkout ' + args.target)
rc = shell.runshell(cmd.split(), work_dir + "/pipeline")
raise Exception("Checkout failed")
cmd = ('git merge origin/' + args.sourcebranch)
rc = shell.runshell(cmd.split(), work_dir + "/pipeline")
raise Exception("Merge failed")