1
0
Fork 0

another try with different paths

This commit is contained in:
Christian Kühnel 2019-10-18 14:48:29 +02:00
parent a33d2ce141
commit 554461f344
2 changed files with 8 additions and 4 deletions

View file

@ -34,7 +34,9 @@ pipeline {
}
stage('arc patch') {
steps {
sh 'llvm-premerge-checks/scripts/phabtalk/apply_patch.py --host="https://reviews.llvm.org" --conduit-token="${CONDUIT_TOKEN}"'
dir("llvm-premerge-checks/scripts/phabtalk"){
sh 'apply_patch.py --host="https://reviews.llvm.org" --conduit-token="${CONDUIT_TOKEN}"'
}
}
}
stage('CMake') {

View file

@ -34,12 +34,14 @@ def _get_parent_hash(diff_id: str, phab:Phabricator) -> str:
diff = phab.differential.getdiff(diff_id=diff_id)
return diff['sourceControlBaseRevision']
def _git_checkout(git_hash:str):
subprocess.check_call('git reset --hard {}'.format(git_hash), shell=True)
subprocess.check_call('git reset --hard "{}"'.format(git_hash), shell=True)
subprocess.check_call('git clean -fdx', shell=True)
def _apply_patch(diff_id: str, conduit_token: str, host: str):
cmd = 'arc patch --nobranch --no-ansi --diff {} --nocommit '\
cmd = 'arc patch --nobranch --no-ansi --diff "{}" --nocommit '\
'--conduit-token "{}" --conduit-uri "{}"'.format(
diff_id, conduit_token, host )
subprocess.call(cmd, shell=True)
@ -49,7 +51,7 @@ def _parse_args():
parser = argparse.ArgumentParser(description='Apply a phabricator patch.')
parser.add_argument('--conduit-token', type=str, dest='conduit_token', default=None)
parser.add_argument('--host', type=str, dest='host', default="None",
help="full URL to API with trailing slash, e.g. https://reviews.llvm.org/api/")
help="full URL to API without trailing slash, e.g. https://reviews.llvm.org")
return parser.parse_args()