Skip to content
Snippets Groups Projects

Fix message on new release (BMK-143)

Merged Andrea Valassi requested to merge valassi/hep-workloads:BMK-143 into qa
1 file
+ 24
15
Compare changes
  • Side-by-side
  • Inline
+ 24
15
@@ -28,6 +28,7 @@ function execute_command(){
# Load the spec file and validate it against common naming conventions (BMK-135)
# Input $1: path to the HEPWL spec file
# [Eventually this could use readonly bash variables and check if any HEPWL_ variables are already defined?]
function load_and_validate_specfile(){
if [ "$1" == "" ] || [ "$2" != "" ]; then
@@ -418,7 +419,10 @@ function publish_standalone_image(){
# Announce the standalone HEP workload image with a local /cvmfs (BMK-80)
# (send an email from ${CI_MAIL_FROM} to ${CI_ANNOUNCE_TO} announcing a new image created in ${CI_JOB_URL})
# Input $1: docker image, including registry prefix (registry/image_name:image_tag)
# Input environment variable ${HEPWL_DOCKERIMAGENAME}: image name for the HEP workload
# Input environment variable ${HEPWL_DOCKERIMAGETAG}: image tag for the standalone HEP workload
# Input environment variable ${CIENV_DOCKERREGISTRY}: registry where the image should be pushed
# Input environment variable ${CI_BUILD_TOKEN}: authentication token for the gitlab registry
# Input environment variables ${CI_MAIL_FROM}, ${CI_ANNOUNCE_TO} and ${CI_JOB_URL}
# Input environment variable ${HEPWL_BMKANNOUNCE}: if exists and "false", do not announce the release
function announce_standalone_image(){
@@ -427,21 +431,26 @@ function announce_standalone_image(){
echo "[announce_standalone_image] current directory is $(pwd)"
echo "[announce_standalone_image] send mail from CI_MAIL_FROM='${CI_MAIL_FROM}'"
echo "[announce_standalone_image] send mail to CI_ANNOUNCE_TO='${CI_ANNOUNCE_TO}'"
if [ "${HEPWL_BMKANNOUNCE}" == "false" ]; then
echo "[announce_standalone_image] WARNING! no mail sent, HEPWL_BMKANNOUNCE is '${HEPWL_BMKANNOUNCE}'"
elif [ "${CI_MAIL_FROM}" == "" ] || [ "${CI_ANNOUNCE_TO}" == "" ]; then
echo "[announce_standalone_image] WARNING! no mail sent, invalid CI_MAIL_FROM or CI_ANNOUNCE_TO"
if [ "${CIENV_DOCKERREGISTRY}" == "" ]; then
echo "[annnounce_standalone_image] WARNING: empty CIENV_DOCKERREGISTRY, nothing to do"
else
theimage=$1
postfix start
announcement="announce.txt"
echo -e "Dear HEP Benchmark developers, \n" > $announcement
echo -e "we are pleased to inform that a new version has been released for the container image \n\n${theimage}" >> $announcement
echo -e "\nPlease DO NOT REPLY\nReport automatically generated from GitLab CI in job ${CI_JOB_URL}\n[$(date)]" >> $announcement
echo -e "\nYours sincerely,\nHEPiX Benchmarking Working Group\n\n" >> $announcement
cat $announcement
cat $announcement | mail -r ${CI_MAIL_FROM} -s "New Docker container available $theimage" ${CI_ANNOUNCE_TO}
sleep 100s # keep the container alive, otherwise no email is sent (emails are sent only once per minute, see BMK-80)
theimage="${CIENV_DOCKERREGISTRY}/${HEPWL_DOCKERIMAGENAME}:${HEPWL_DOCKERIMAGETAG}"
echo "[announce_standalone_image] theimage: $theimage"
if [ "${HEPWL_BMKANNOUNCE}" == "false" ]; then
echo "[announce_standalone_image] WARNING! no mail sent, HEPWL_BMKANNOUNCE is '${HEPWL_BMKANNOUNCE}'"
elif [ "${CI_MAIL_FROM}" == "" ] || [ "${CI_ANNOUNCE_TO}" == "" ]; then
echo "[announce_standalone_image] WARNING! no mail sent, invalid CI_MAIL_FROM or CI_ANNOUNCE_TO"
else
postfix start
announcement="announce.txt"
echo -e "Dear HEP Benchmark developers, \n" > $announcement
echo -e "we are pleased to inform that a new version has been released for the container image \n\n${theimage}" >> $announcement
echo -e "\nPlease DO NOT REPLY\nReport automatically generated from GitLab CI in job ${CI_JOB_URL}\n[$(date)]" >> $announcement
echo -e "\nYours sincerely,\nHEPiX Benchmarking Working Group\n\n" >> $announcement
cat $announcement
cat $announcement | mail -r ${CI_MAIL_FROM} -s "New Docker container available $theimage" ${CI_ANNOUNCE_TO}
sleep 100s # keep the container alive, otherwise no email is sent (emails are sent only once per minute, see BMK-80)
fi
fi
echo "[announce_standalone_image] finished at $(date)"
return 0
Loading