From 3897bf5833110387e7e38f388cdbb03fe350d83f Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 30 Oct 2023 10:55:01 +0000 Subject: [PATCH] planet: first copy to s3 --- cookbooks/planet/templates/default/planetdump.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cookbooks/planet/templates/default/planetdump.erb b/cookbooks/planet/templates/default/planetdump.erb index 0abf40e97..3aa1bece6 100644 --- a/cookbooks/planet/templates/default/planetdump.erb +++ b/cookbooks/planet/templates/default/planetdump.erb @@ -149,6 +149,12 @@ function install_dump { local rss_file="${type}-${format}-rss.xml" md5sum "${name}" > "${name}.md5" + + # Upload all files to S3 + /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${name}.md5" "${s3dir}/${name}.md5" + /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${name}.torrent" "${s3dir}/${name}.torrent" + /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${name}" "${s3dir}/${name}" + mkdir -p "${dir}/${year}" mv "${name}" "${name}.md5" "${dir}/${year}" ln -sf "${year:-.}/${name}" "${dir}/${latest}" @@ -156,10 +162,6 @@ function install_dump { test -f "${rss_file}" && xmllint --noout "${rss_file}" && cp -f "${rss_file}" "${dir}" rm -f "${dir}/${latest}.md5" sed -e "s/${name}/${latest}/" "${dir}/${year}/${name}.md5" > "${dir}/${latest}.md5" - - /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${dir}/${year}/${name}.md5" "${s3dir}/${name}.md5" - /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${dir}/${year}/${name}" "${s3dir}/${name}" - /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${dir}/${year}/${name}.torrent" "${s3dir}/${name}.torrent" } # Create *.torrent files -- 2.39.5