Created
December 25, 2018 09:45
-
-
Save onigra/4391e0dde704e832da0e9a9dc160eaed to your computer and use it in GitHub Desktop.
remove artifacts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3 ls \ | |
s3://bucket/artifacts \ | |
--recursive \ | |
--human-readable | \ | |
grep manifest.yml | \ | |
sort -r | \ | |
tail -n+20 | \ | |
awk -F ' ' '{ print $5 }' | \ | |
sed -e 's/\(artifacts\/.*\)\/namespace\/manifest\.yml/s3:\/\/bucket\/\1/g' | \ | |
xargs -I{} aws s3 rm --recursive "{}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment