CIPD needs the directory to be relative (flutter/engine#13461)

* [recipe] Pass the out-dir argument in the recipe

* CIPD needs the yaml definition to be relative to the upload dir
This commit is contained in:
Kaushik Iska
2019-10-31 12:23:11 -07:00
committed by GitHub
parent e91e19f3df
commit 8a30840904
2 changed files with 15 additions and 5 deletions

View File

@@ -1,5 +1,10 @@
# Recipe Changelog
## 30 Oct 2019
* Recipe Link: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1891522
* Reason: Pass the `out-dir` arg in the recipe.
## 29 Oct 2019
* Recipe Link: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1887742

View File

@@ -14,13 +14,16 @@ import platform
import shutil
import subprocess
import sys
import tempfile
def IsLinux():
return platform.system() == 'Linux'
def GetPackagingDir(out_dir):
return os.path.abspath(os.path.join(out_dir, os.pardir))
def CreateCIPDDefinition(target_arch, out_dir):
dir_name = os.path.basename(os.path.normpath(out_dir))
return """
@@ -32,16 +35,18 @@ data:
""" % (target_arch, target_arch, dir_name)
# CIPD CLI needs the definition and data directory to be relative to each other.
def WriteCIPDDefinition(target_arch, out_dir):
_, temp_file = tempfile.mkstemp(suffix='.yaml')
with open(temp_file, 'w') as f:
_packaging_dir = GetPackagingDir(out_dir)
yaml_file = os.path.join(_packaging_dir, 'debug_symbols.cipd.yaml')
with open(yaml_file, 'w') as f:
cipd_def = CreateCIPDDefinition(target_arch, out_dir)
f.write(cipd_def)
return temp_file
return yaml_file
def ProcessCIPDPackage(upload, cipd_yaml, engine_version, out_dir, target_arch):
_packaging_dir = os.path.abspath(os.path.join(out_dir, os.pardir))
_packaging_dir = GetPackagingDir(out_dir)
if upload and IsLinux():
command = [
'cipd', 'create', '-pkg-def', cipd_yaml, '-ref', 'latest', '-tag',