Skip to content
Snippets Groups Projects
Commit cad2ae83 authored by Alex Iribarren's avatar Alex Iribarren
Browse files

Merge branch 'nopackages' into 'master'

Send an email to admins in the event that there are no new packages

See merge request !14
parents b98ca251 0b6d6d2f
No related branches found
No related tags found
1 merge request!14Send an email to admins in the event that there are no new packages
Pipeline #2409974 passed
To: $EMAIL_ADMIN
From: $EMAIL_FROM
Reply-To: noreply.$EMAIL_FROM
Return-Path: $EMAIL_ADMIN
Subject: CS8 - No new packages today
Dear Linux admins,
Just a quick message to let you know that there were no new upstream CentOS Stream 8 packages today.
Here's the current state of the symlinks:
$STATE
Have a nice day!
---
Best regards,
CERN Linux Droid
(on behalf of the friendly humans of Linux Support)
...@@ -43,8 +43,35 @@ for ARCH in $CENTOS_ARCHES; do ...@@ -43,8 +43,35 @@ for ARCH in $CENTOS_ARCHES; do
done done
done done
if [[ $CHANNEL == "daily" ]]; then
STATE=""
while IFS= read -r LINE; do
MODTIME="`echo $LINE | cut -d'.' -f1`"
LINK="`echo $LINE | cut -d' ' -f2`"
TARGET="`readlink $DESTINATION/$LINK`"
STATE="$STATE `printf '%-20s' "$LINK"` -> $TARGET (modified $MODTIME)\n"
done <<< "`find $DESTINATION -maxdepth 1 -type l -name \"${RELEASE}*\" -printf '%T+ %P\n' | sort | tail -n 10`"
# grab the last 10 symlinks so we can see the state of the previous point release as well
FROZEN=`find $DESTINATION -maxdepth 1 -type f -name ".freeze.${RELEASE}*" -print -quit`
if [[ -n "$FROZEN" ]]; then
STATE="$STATE\n ***************************************************\n"
STATE="$STATE *** .freeze.${RELEASE}* exists, links won't be updated ***\n"
STATE="$STATE ***************************************************\n"
fi
export STATE="`printf "$STATE"`"
fi
# There are no diffs to report on, we can stop # There are no diffs to report on, we can stop
[[ ! -s "$TMPDIR/.longlist" ]] && exit if [[ ! -s "$TMPDIR/.longlist" ]]; then
if [[ $CHANNEL == "daily" ]]; then
# But let's inform the admins (so they don't worry unneccessarily)
envsubst < /root/email_nopackages.tpl >> "$TMPDIR/.email"
cat "$TMPDIR/.email" | swaks --server $MAILMX --to $EMAIL_TO --data -
rm "$TMPDIR/.email"
fi
exit
fi
# Update website # Update website
if [[ $CHANNEL == "production" ]] || [[ $CHANNEL == "testing" ]]; then if [[ $CHANNEL == "production" ]] || [[ $CHANNEL == "testing" ]]; then
...@@ -67,25 +94,6 @@ export TODAY="$TODAY" ...@@ -67,25 +94,6 @@ export TODAY="$TODAY"
export SHORTLIST="`echo "$SHORTLIST" | sed 's/\b\s\+\b/, /g'`" export SHORTLIST="`echo "$SHORTLIST" | sed 's/\b\s\+\b/, /g'`"
export WEBSITE export WEBSITE
if [[ $CHANNEL == "daily" ]]; then
STATE=""
while IFS= read -r LINE; do
MODTIME="`echo $LINE | cut -d'.' -f1`"
LINK="`echo $LINE | cut -d' ' -f2`"
TARGET="`readlink $DESTINATION/$LINK`"
STATE="$STATE `printf '%-20s' "$LINK"` -> $TARGET (modified $MODTIME)\n"
done <<< "`find $DESTINATION -maxdepth 1 -type l -name \"${RELEASE}*\" -printf '%T+ %P\n' | sort | tail -n 10`"
# grab the last 10 symlinks so we can see the state of the previous point release as well
FROZEN=`find $DESTINATION -maxdepth 1 -type f -name ".freeze.${RELEASE}*" -print -quit`
if [[ -n "$FROZEN" ]]; then
STATE="$STATE\n ***************************************************\n"
STATE="$STATE *** .freeze.${RELEASE}* exists, links won't be updated ***\n"
STATE="$STATE ***************************************************\n"
fi
export STATE="`printf "$STATE"`"
fi
envsubst < $TEMPLATE | sed '/^--PACKAGES--$/Q' > "$TMPDIR/.email" envsubst < $TEMPLATE | sed '/^--PACKAGES--$/Q' > "$TMPDIR/.email"
for ARCH in $CENTOS_ARCHES; do for ARCH in $CENTOS_ARCHES; do
for REPO in $ALL_REPOS; do for REPO in $ALL_REPOS; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment