Skip to content

Commit

Permalink
log level
Browse files Browse the repository at this point in the history
Signed-off-by: flakey5 <[email protected]>
  • Loading branch information
flakey5 committed Nov 7, 2024
1 parent 22d7aa4 commit aa17808
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
23 changes: 20 additions & 3 deletions ansible/www-standalone/tools/promote/_resha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

1 change: 1 addition & 0 deletions ansible/www-standalone/tools/promote/settings
Original file line number Diff line number Diff line change
Expand Up @@ -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")
21 changes: 18 additions & 3 deletions ansible/www-standalone/tools/promote/upload_to_cloudflare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aa17808

Please sign in to comment.