mirror of
https://github.com/ryantm/nixpkgs-update.git
synced 2024-10-26 23:14:39 +03:00
parent
ba6f302cd1
commit
b4e91fbc30
9
up.sh
9
up.sh
@ -7,6 +7,7 @@ export NIX_PATH
|
||||
PACKAGE_NAME=$1
|
||||
OLD_VERSION=$2
|
||||
NEW_VERSION=$3
|
||||
OK_TO_PR_AT=$4
|
||||
|
||||
BRANCH_NAME="auto-update/$1"
|
||||
|
||||
@ -170,6 +171,14 @@ if [[ -v DRY_RUN ]]
|
||||
then
|
||||
true
|
||||
else
|
||||
CURRENT=$(date +%s)
|
||||
if (( CURRENT < OK_TO_PR_AT ))
|
||||
then
|
||||
SLEEP_SECONDS=$(( OK_TO_PR_AT - CURRENT ))
|
||||
echo "Sleeping $SLEEP_SECONDS seconds."
|
||||
sleep "$SLEEP_SECONDS"
|
||||
fi
|
||||
|
||||
hub pull-request -m "$PR_MESSAGE"
|
||||
fi
|
||||
|
||||
|
5
ups.sh
5
ups.sh
@ -31,15 +31,16 @@ echo "
|
||||
|
||||
$(date -Iseconds) New run of ups.sh" >> $LOG_FILE
|
||||
|
||||
OK_TO_PR_AT=0
|
||||
IFS=$'\n'
|
||||
for a in $ARGUMENTS
|
||||
do
|
||||
unset IFS
|
||||
echo "$(date -Iseconds) $a" >> $LOG_FILE
|
||||
if eval "$SCRIPT_DIR/up.sh $a 3>>$LOG_FILE"
|
||||
if eval "$SCRIPT_DIR/up.sh $a $OK_TO_PR_AT 3>>$LOG_FILE"
|
||||
then
|
||||
echo "$(date -Iseconds) SUCCESS" >> $LOG_FILE
|
||||
sleep 900
|
||||
OK_TO_PR_AT=$(date +%s -d "+15 minutes")
|
||||
else
|
||||
echo "$(date -Iseconds) FAIL" >> $LOG_FILE
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user