From aa17808f29bb96be9d93c95be8703100ccb4fa9c Mon Sep 17 00:00:00 2001 From: flakey5 <73616808+flakey5@users.noreply.github.com> Date: Thu, 7 Nov 2024 05:47:05 -0800 Subject: [PATCH] log level Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com> --- .../www-standalone/tools/promote/_resha.sh | 23 ++++++++++++++++--- ansible/www-standalone/tools/promote/settings | 1 + .../tools/promote/upload_to_cloudflare.sh | 21 ++++++++++++++--- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/ansible/www-standalone/tools/promote/_resha.sh b/ansible/www-standalone/tools/promote/_resha.sh index 25efd5c1e..8016f96fb 100755 --- a/ansible/www-standalone/tools/promote/_resha.sh +++ b/ansible/www-standalone/tools/promote/_resha.sh @@ -39,6 +39,10 @@ if [ -z ${rclone_log+x} ]; then exit 1 fi +if [ -z ${rclone_log_level+x} ]; then + rclone_log_level=INFO +fi + (cd "${dstdir}/${version}" && shasum -a256 $(ls node* openssl* iojs* win-*/* x64/* 2> /dev/null) > SHASUMS256.txt) || exit 1 if [[ $version =~ ^v[0] ]]; then (cd "${dstdir}/${version}" && shasum $(ls node* openssl* x64/* 2> /dev/null) > SHASUMS.txt) || exit 1 @@ -49,6 +53,19 @@ find "${dstdir}/${version}" -type f -exec chmod 644 '{}' \; find "${dstdir}/${version}" -type d -exec chmod 755 '{}' \; relativedir=${dstdir/$dist_rootdir/"$site/"} -rclone copyto --log-file=${rclone_log} ${dstdir}/index.json $staging_bucket/$relativedir/index.json > /dev/null -rclone copyto --log-file=${rclone_log} ${dstdir}/index.tab $staging_bucket/$relativedir/index.tab > /dev/null -rclone copyto --log-file=${rclone_log} ${dstdir}/${version}/SHASUMS256.txt $staging_bucket/$relativedir/${version}/SHASUMS256.txt > /dev/null +rclone copyto \ + --log-level=${rclone_log_level} \ + --log-file=${rclone_log} \ + ${dstdir}/index.json \ + $staging_bucket/$relativedir/index.json > /dev/null +rclone copyto \ + --log-level=${rclone_log_level} \ + --log-file=${rclone_log} \ + ${dstdir}/index.tab \ + $staging_bucket/$relativedir/index.tab > /dev/null +rclone copyto \ + --log-level=${rclone_log_level} \ + --log-file=${rclone_log} \ + ${dstdir}/${version}/SHASUMS256.txt \ + $staging_bucket/$relativedir/${version}/SHASUMS256.txt > /dev/null + \ No newline at end of file diff --git a/ansible/www-standalone/tools/promote/settings b/ansible/www-standalone/tools/promote/settings index ea41ff7df..e4eeafd86 100755 --- a/ansible/www-standalone/tools/promote/settings +++ b/ansible/www-standalone/tools/promote/settings @@ -41,4 +41,5 @@ prod_bucket=r2:dist-prod staging_bucket=r2:dist-staging # format: yyyy-mm-dd-hh-mm-ss.log +rclone_log_level=INFO rclone_log=${dist_rootdir}rclone/$(date "+%F-%H-%M-%S.log") diff --git a/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh b/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh index 12e9c658a..2ce518948 100755 --- a/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh +++ b/ansible/www-standalone/tools/promote/upload_to_cloudflare.sh @@ -34,11 +34,26 @@ if [ -z ${rclone_log+x} ]; then echo "\$rlone_log is not set" exit 1 fi +if [ -z ${rclone_log_level+x} ]; then + rclone_log_level=INFO +fi relative_srcdir=${srcdir/$staging_rootdir/"$site/"} relative_dstdir=${dstdir/$dist_rootdir/"$site/"} tmpversion=$2 -rclone copy --log-file=$rclone_log $staging_bucket/$relative_srcdir/$tmpversion/ $prod_bucket/$relative_dstdir/$tmpversion/ -rclone copyto --log-file=$rclone_log $staging_bucket/$relative_dstdir/index.json $prod_bucket/$relative_dstdir/index.json -rclone copyto --log-file=$rclone_log $staging_bucket/$relative_dstdir/index.tab $prod_bucket/$relative_dstdir/index.tab +rclone copy \ + --log-level=$rclone_log_level \ + --log-file=$rclone_log \ + $staging_bucket/$relative_srcdir/$tmpversion/ \ + $prod_bucket/$relative_dstdir/$tmpversion/ +rclone copyto \ + --log-level=$rclone_log_level \ + --log-file=$rclone_log \ + $staging_bucket/$relative_dstdir/index.json \ + $prod_bucket/$relative_dstdir/index.json +rclone copyto \ + --log-level=$rclone_log_level \ + --log-file=$rclone_log \ + $staging_bucket/$relative_dstdir/index.tab \ + $prod_bucket/$relative_dstdir/index.tab