diff --git a/docker/frontend/authmap-preprod.cron b/docker/frontend/authmap-preprod.cron deleted file mode 100644 index b76717e13..000000000 --- a/docker/frontend/authmap-preprod.cron +++ /dev/null @@ -1,2 +0,0 @@ -*/15 * * * * sleep $((RANDOM % 601)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh - diff --git a/docker/frontend/authmap-preprod.sh b/docker/frontend/authmap-preprod.sh new file mode 100644 index 000000000..26e8fe4fd --- /dev/null +++ b/docker/frontend/authmap-preprod.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Print a message to indicate the script is running +echo "authmap-preprod.sh is running" + +'sleep $((RANDOM % 601))' && '/data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem' && '[ $? -ne 0 ] && /bin/bash /data/alerts.sh' diff --git a/docker/frontend/authmap-prod.cron b/docker/frontend/authmap-prod.cron deleted file mode 100644 index b76717e13..000000000 --- a/docker/frontend/authmap-prod.cron +++ /dev/null @@ -1,2 +0,0 @@ -*/15 * * * * sleep $((RANDOM % 601)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh - diff --git a/docker/frontend/authmap-prod.sh b/docker/frontend/authmap-prod.sh new file mode 100644 index 000000000..6c21ecb54 --- /dev/null +++ b/docker/frontend/authmap-prod.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Print a message to indicate the script is running + +'sleep $((RANDOM % 601))' && '/data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem' && '[ $? -ne 0 ] && /bin/bash /data/alerts.sh' diff --git a/docker/frontend/authmap-test.cron b/docker/frontend/authmap-test.cron deleted file mode 100644 index 2575d1f78..000000000 --- a/docker/frontend/authmap-test.cron +++ /dev/null @@ -1,2 +0,0 @@ -*/30 * * * * sleep $((RANDOM % 901)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh - diff --git a/docker/frontend/authmap-test.sh b/docker/frontend/authmap-test.sh new file mode 100644 index 000000000..10773d9c5 --- /dev/null +++ b/docker/frontend/authmap-test.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Print a message to indicate the script is running +'sleep $((RANDOM % 901))' && '/data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem' && '[ $? -ne 0 ] && /bin/bash /data/alerts.sh' diff --git a/docker/frontend/copy_cron.sh b/docker/frontend/copy_cron.sh index d630855cb..9d301bd87 100755 --- a/docker/frontend/copy_cron.sh +++ b/docker/frontend/copy_cron.sh @@ -1,15 +1,15 @@ if [ "$ENVIRONMENT" = "k8s-prod" ]; then # Copy the production cron file echo "Copying authmap-prod.cron" - cp /tmp/authmap-prod.cron /tmp/authmap.cron + echo "*/15 * * * * /tmp/authmap-prod" > /tmp/authmap.cron elif [ "$ENVIRONMENT" = "k8s-preprod" ]; then # Copy the development cron file echo "Copying authmap-preprod.cron" - cp /tmp/authmap-preprod.cron /tmp/authmap.cron + echo "*/15 * * * * /tmp/authmap-prod" > /tmp/authmap.cron elif [[ "$ENVIRONMENT" == k8s-test* ]]; then # Copy the test cron file echo "Copying authmap-test.cron" - cp /tmp/authmap-test.cron /tmp/authmap.cron + echo "*/15 * * * * /tmp/authmap-test.sh" > /tmp/authmap.cron else echo "Unsupported environment: $ENVIRONMENT"