]> git.openstreetmap.org Git - chef.git/commitdiff
planet: first copy to s3
authorGrant Slater <github@firefishy.com>
Mon, 30 Oct 2023 10:55:01 +0000 (10:55 +0000)
committerGrant <github@firefishy.com>
Mon, 30 Oct 2023 15:23:13 +0000 (15:23 +0000)
cookbooks/planet/templates/default/planetdump.erb

index 0abf40e97d8f54bc470e4e51cddbec1033489db0..3aa1bece6378f7372c779091d493a9a9ec2b184e 100644 (file)
@@ -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