Skip to content

Commit f579ea1

Browse files
devversionkara
authored andcommitted
build: faster artifacts deploy script (#5149)
1 parent 734eccc commit f579ea1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

scripts/deploy/publish-build-artifacts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ publishPackage() {
4242
rm -rf ${repoDir}
4343
mkdir -p ${repoDir}
4444

45-
# Clone the repository
46-
git clone ${repoUrl} ${repoDir}
45+
# Clone the repository and only fetch the last commit to download less unused data.
46+
git clone ${repoUrl} ${repoDir} --depth 1
4747

4848
# Copy the build files to the repository
4949
rm -rf ${repoDir}/*

scripts/deploy/publish-docs-content.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ commitMessage="$(git log --oneline -n 1)"
2525
# create directory and clone test repo
2626
rm -rf $repoPath
2727
mkdir -p $repoPath
28-
git clone $repoUrl $repoPath
28+
git clone $repoUrl $repoPath --depth 1
2929

3030
# Clean out repo directory and copy contents of dist/docs into it
3131
rm -rf $repoPath/*

tools/gulp/tasks/payload.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ async function uploadPayloadResults(database: firebaseAdmin.database.Database, c
146146
async function getPayloadResults(database: firebaseAdmin.database.Database, commitSha: string) {
147147
const snapshot = await database.ref('payloads').child(commitSha).once('value');
148148

149-
if (!snapshot.exists()) {
150-
throw `There is no payload data uploaded for SHA ${commitSha}`;
149+
if (snapshot.exists()) {
150+
return snapshot.val();
151+
} else {
152+
console.error(`There is no payload data uploaded for SHA ${commitSha}`);
151153
}
152-
153-
return snapshot.val();
154154
}
155155

156156
/** Gets the SHA of the commit where the payload was uploaded before this Travis Job started. */

0 commit comments

Comments
 (0)