Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (27 sloc) 1.18 KB
if [ x"$BUCKET" == "x" ]; then
echo "needs buckets"
exit 1
echo "TEST: deploying to BUCKET: $BUCKET"
gsutil stat gs://$BUCKET/feed.xml
echo "TEST: fetching feed.xml before compiling and putting it in /tmp/feed2.xml"
wget$BUCKET/feed.xml -O /tmp/feed2.xml
# go run all except *_test.go files (handy when we get around to add testing :)
shopt -s extglob
go run !(*_test).go -rss -topic GW,gw,S3,s3,keystone,civet > feed.xml
echo "TEST: Showing diff between old and new feed.xml"
diff -u /tmp/feed2.xml feed.xml
# diff existing and now built feed.xml. Only show lines that have changed. Exclude some patterns and count the rest.
NUMCHANGEDLINES=$(diff -u /tmp/feed2.xml feed.xml|grep "^+\ "|grep -c -v -e pubDate -e link -e guid)
echo "TEST: number of changed content: $NUMCHANGEDLINES"
echo "TEST: listing dir"
ls -l
if [ $NUMCHANGEDLINES -gt 0 ]; then
echo "DEPLOY: uploading feed.xml publicly to $BUCKET"
gsutil cp -a public-read feed.xml gs://$BUCKET/feed.xml
echo "NOT DEPLOYING: $NUMCHANGEDLINES changes in the feed.xml"