A full featured blog in RiotJS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
795 B

#! /bin/bash
function updateLinks() {
revision_id=$(curl http://$COUCHDB_USER:$COUCHDB_PASSWORD@127.0.0.1:5984/$COUCHDB_NAME/links | jq -r "._rev")
echo "$revision_id"
if [ $? == 0 ];
then
curl -XDELETE "http://$COUCHDB_USER:$COUCHDB_PASSWORD@127.0.0.1:5984/$COUCHDB_NAME/links?rev=$revision_id" || true
fi
curl -XPUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@127.0.0.1:5984/$COUCHDB_NAME/links -d @/src/link.json || true
}
curl 127.0.0.1:5984 2> /dev/null
while [ $? != 0 ]; do
curl 127.0.0.1:5984 2> /dev/null
sleep 5;
done
curl -XPUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@127.0.0.1:5984/$COUCHDB_NAME || true
curl -XPUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@127.0.0.1:5984/$COUCHDB_NAME/_design/blogPosts -d @/src/blogPosts.json || true
updateLinks
exec python3 "$@"