mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 12:45:21 +01:00
Automate download page generation
This commit is contained in:
@@ -25,4 +25,7 @@ after_success:
|
||||
mkdir dist
|
||||
mv *.deb *.rpm dist/
|
||||
aws s3 sync dist/ s3://go.mozilla.org/sops/dist/ --acl public-read
|
||||
make download-index
|
||||
mv index.html dist/
|
||||
aws s3 sync dist/ s3://go.mozilla.org/sops/dist/ --acl public-read
|
||||
fi
|
||||
|
||||
3
Makefile
3
Makefile
@@ -88,4 +88,7 @@ else
|
||||
-o tmppkg/sops-$$(git describe --abbrev=0 --tags).dmg tmpdmg
|
||||
endif
|
||||
|
||||
download-index:
|
||||
bash make_download_page.sh
|
||||
|
||||
.PHONY: all test generate clean vendor functional-tests
|
||||
|
||||
11
make_download_page.sh
Normal file
11
make_download_page.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
[ ! -d dist ] && mkdir dist
|
||||
echo -e "<html>\n<head><title>Sops download page></title>\n<body>\n<h1>Sops download page</h1>\n<h2><a href="https://go.mozilla.org/sops/">go.mozilla.org/sops</a></h2>\n<table>" > index.html
|
||||
IFS=$'\n'
|
||||
for dist in $(aws s3 ls s3://go.mozilla.org/sops/dist/ | grep -P "deb|rpm"); do
|
||||
ts=$(echo $dist|awk '{print $1,$2}')
|
||||
size=$(echo $dist|awk '{print $3}')
|
||||
pkg=$(echo $dist|awk '{print $4}')
|
||||
echo -e "<tr><td>$ts</td><td>$size</td><td><a href=\"https://go.mozilla.org/sops/dist/$pkg\">$pkg</a></td></tr>" >> index.html
|
||||
done
|
||||
echo -e "</table>\n</body>\n</html>" >> index.html
|
||||
Reference in New Issue
Block a user