Thank you Robert for the great article! I am using a very similar setup and approach for the webpack(er) generated assets.
I wrote a gem called webpacker_uploader which parses the contents of the generated manifest.json file and then uploads all the file's entries to S3 using the aws-sdk-s3 gem.
By using this gem as an abstraction we can get away with storing credentials in .aws/credentials. We just call WebpackerUploader.upload!(provider) in a Rake task and we pass in the credentials through ENV variables from the CI. However, this approach will not work if you need to upload assets that are not present in the manifest file, as we rely on its contents.
Thank you Robert for the great article! I am using a very similar setup and approach for the webpack(er) generated assets.
I wrote a gem called webpacker_uploader which parses the contents of the generated manifest.json file and then uploads all the file's entries to S3 using the
aws-sdk-s3
gem.By using this gem as an abstraction we can get away with storing credentials in
.aws/credentials
. We just callWebpackerUploader.upload!(provider)
in a Rake task and we pass in the credentials through ENV variables from the CI. However, this approach will not work if you need to upload assets that are not present in the manifest file, as we rely on its contents.Hey Tasos! Thanks for the note to webpacker_uploader. That looks interesting!