Skip to content

Commit e546695

Browse files
authored
add timestamp to the .tgz bundle name to avoid GCF caching old versions of it (#539)
1 parent beb2c38 commit e546695

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

integration_test/run_tests.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if [[ "${1}" == "" ]]; then
2020
fi
2121

2222
PROJECT_ID="${1}"
23+
TIMESTAMP=$(date +%s)
2324
TOKEN="${2}"
2425

2526
# Directory where this script lives.
@@ -34,17 +35,19 @@ function build_sdk {
3435
cd "${DIR}/.."
3536
rm -f firebase-functions-*.tgz
3637
npm run build:pack
37-
mv firebase-functions-*.tgz integration_test/functions/firebase-functions.tgz
38+
mv firebase-functions-*.tgz "integration_test/functions/firebase-functions-${TIMESTAMP}.tgz"
3839
}
3940

4041
function pick_node8 {
4142
cd "${DIR}"
4243
cp package.node8.json functions/package.json
44+
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
4345
}
4446

4547
function pick_node10 {
4648
cd "${DIR}"
4749
cp package.node10.json functions/package.json
50+
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
4851
}
4952

5053
function install_deps {
@@ -98,7 +101,7 @@ function run_tests {
98101
function cleanup {
99102
announce "Performing cleanup..."
100103
delete_all_functions
101-
rm "${DIR}/functions/firebase-functions.tgz"
104+
rm "${DIR}/functions/firebase-functions-*.tgz"
102105
rm "${DIR}/functions/package.json"
103106
rm -f "${DIR}/functions/firebase-debug.log"
104107
rm -rf "${DIR}/functions/lib"

0 commit comments

Comments
 (0)