build: faster artifacts deploy script (#5149)

This commit is contained in:
Paul Gschwendtner
2017-06-15 22:31:15 +02:00
committed by Kara
parent 734eccc148
commit f579ea130f
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ publishPackage() {
rm -rf ${repoDir}
mkdir -p ${repoDir}
# Clone the repository
git clone ${repoUrl} ${repoDir}
# Clone the repository and only fetch the last commit to download less unused data.
git clone ${repoUrl} ${repoDir} --depth 1
# Copy the build files to the repository
rm -rf ${repoDir}/*
+1 -1
View File
@@ -25,7 +25,7 @@ commitMessage="$(git log --oneline -n 1)"
# create directory and clone test repo
rm -rf $repoPath
mkdir -p $repoPath
git clone $repoUrl $repoPath
git clone $repoUrl $repoPath --depth 1
# Clean out repo directory and copy contents of dist/docs into it
rm -rf $repoPath/*
+4 -4
View File
@@ -146,11 +146,11 @@ async function uploadPayloadResults(database: firebaseAdmin.database.Database, c
async function getPayloadResults(database: firebaseAdmin.database.Database, commitSha: string) {
const snapshot = await database.ref('payloads').child(commitSha).once('value');
if (!snapshot.exists()) {
throw `There is no payload data uploaded for SHA ${commitSha}`;
if (snapshot.exists()) {
return snapshot.val();
} else {
console.error(`There is no payload data uploaded for SHA ${commitSha}`);
}
return snapshot.val();
}
/** Gets the SHA of the commit where the payload was uploaded before this Travis Job started. */