Allow pushing updated WPT results to git remote.

This commit is contained in:
Josh Matthews 2019-05-21 15:09:38 -04:00
parent 2406d0973a
commit ceff9a61ef
2 changed files with 8 additions and 7 deletions

View file

@ -490,7 +490,8 @@ def update_wpt():
"etc/taskcluster/macos/Brewfile-wpt", "etc/taskcluster/macos/Brewfile-wpt",
"etc/taskcluster/macos/Brewfile-gstreamer", "etc/taskcluster/macos/Brewfile-gstreamer",
]) ])
.with_repo() # Pushing the new changes to the git remote requires a full repo clone.
.with_repo(shallow=False)
.with_curl_artifact_script(build_task, "target.tar.gz") .with_curl_artifact_script(build_task, "target.tar.gz")
.with_script(""" .with_script("""
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/" export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/"

View file

@ -427,7 +427,7 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
self.with_early_script("set PATH=%HOMEDRIVE%%HOMEPATH%\\{};%PATH%".format(p)) self.with_early_script("set PATH=%HOMEDRIVE%%HOMEPATH%\\{};%PATH%".format(p))
return self return self
def with_repo(self, sparse_checkout=None): def with_repo(self, sparse_checkout=None, shallow=True):
""" """
Make a shallow clone the git repository at the start of the task. Make a shallow clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`, This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`,
@ -452,9 +452,9 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
type .git\\info\\sparse-checkout type .git\\info\\sparse-checkout
""" """
git += """ git += """
git fetch --depth 1 %GIT_URL% %GIT_REF% git fetch {depth} %GIT_URL% %GIT_REF%
git reset --hard %GIT_SHA% git reset --hard %GIT_SHA%
""" """.format(depth="--depth 1" if shallow else "")
return self \ return self \
.with_git() \ .with_git() \
.with_script(git) \ .with_script(git) \
@ -560,7 +560,7 @@ class UnixTaskMixin(Task):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.curl_scripts_count = 0 self.curl_scripts_count = 0
def with_repo(self): def with_repo(self, shallow=True):
""" """
Make a shallow clone the git repository at the start of the task. Make a shallow clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha` This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`
@ -578,9 +578,9 @@ class UnixTaskMixin(Task):
.with_early_script(""" .with_early_script("""
git init repo git init repo
cd repo cd repo
git fetch --depth 1 "$GIT_URL" "$GIT_REF" git fetch {depth} "$GIT_URL" "$GIT_REF"
git reset --hard "$GIT_SHA" git reset --hard "$GIT_SHA"
""") """.format(depth="--depth 1" if shallow else ""))
def with_curl_script(self, url, file_path): def with_curl_script(self, url, file_path):
self.curl_scripts_count += 1 self.curl_scripts_count += 1