-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(ci): don't spam us with native code notification (#9384)
* run on my branch to test * try using s3 instead for native hash storage * echo beta last, codepush will deploy otherwise * fix s3 upload output being captured by var * fix s3 download being captured by var * add new script to limit number of notifications * hardcode to beta to test * try updating the upload command * revert test changes
- Loading branch information
1 parent
88fd267
commit 30c1e37
Showing
3 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
S3_TIMESTAMP_PATH="s3://artsy-citadel/eigen/last-notified.txt" | ||
|
||
# Attempt to fetch the last notification timestamp | ||
aws s3 cp $S3_TIMESTAMP_PATH ./last-notified.txt > /dev/null || echo "No previous timestamp found." >&2 | ||
|
||
if [ -f ./last-notified.txt ]; then | ||
last_notified=$(cat ./last-notified.txt) | ||
else | ||
last_notified=0 | ||
fi | ||
|
||
current_time=$(date +%s) # Current time in seconds since 1970-01-01 | ||
time_difference=$((current_time - last_notified)) | ||
|
||
# Check if 24 hours (86400 seconds) have passed since the last notification | ||
if [ $time_difference -ge 86400 ]; then | ||
bundle exec fastlane notify_beta_needed | ||
# Update the timestamp | ||
echo $current_time | aws s3 cp - $S3_TIMESTAMP_PATH | ||
fi |