Revisions
-
totherik revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash RELEASE=v2.0.3 BASEDIR=`basename $0` SCRIPTPATH=`cd $(dirname $0) ; pwd -P` -
totherik revised this gist
Feb 25, 2014 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -102,12 +102,16 @@ npm run load assert "$LINENO: Unable to load views." # Ensure _design/app exists res=`curl -s -w "%{http_code}" -X PUT -H 'Content-Type: application/json' -d '{}' $registry/_design/app -o /dev/null` assert "$LINENO: Unable to connect to $host." if [ "$res" != "$CREATED" ] && [ "$res" != "$CONFLICT" ]; then fail "$LINENO: Unable to create _design/app document. Server responded with status code $res"; fi # Install app npm run copy assert "$LINENO: Unable to install couch app." res=`curl -s -w "%{http_code}" -X PUT -H 'Content-Type: application/json' $registry/error%3A%20forbidden -d '{ "_id": "error: forbidden", "forbidden":"must supply latest _rev to update existing package" }' -o /dev/null` assert "$LINENO: Unable to connect to $host" if [ "$res" != "$CREATED" ] && [ "$res" != "$CONFLICT" ]; then fail "$LINENO: Unable to create error document. Server responded with status code $res"; fi clean -
totherik revised this gist
Feb 23, 2014 . 1 changed file with 17 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,13 @@ #!/bin/bash RELEASE=v2.0.2 BASEDIR=`basename $0` SCRIPTPATH=`cd $(dirname $0) ; pwd -P` CREATED=201 CONFLICT=409 PRECONDITION_FAILED=412 function assert { if [ "$?" != "0" ]; then @@ -64,6 +69,11 @@ git clone [email protected]:npm/npmjs.org.git assert "$LINENO: Unable to clone npmjs.org." cd npmjs.org # Get the latest release (don't use master) git checkout tags/$RELEASE assert "$LINENO: Unable to get release $RELEASE." npm install assert "$LINENO: npm install failed." @@ -75,8 +85,13 @@ npm set _npmjs.org:couch=$registry # Create the database res=`curl -s -w "%{http_code}" -X PUT $registry -o /dev/null` assert "$LINENO: Unable to connect to $host." if [ "$res" != "$CREATED" ] && [ "$res" != "$PRECONDITION_FAILED" ]; then fail "$LINENO: Unable to create database \"$database\". Server responded with status code $res"; fi # XXX # Patch env per https://github.com/npm/npmjs.org/commit/2f9dbb9d2f75c96183f9b0cbdbafaa790d380d29 export DEPLOY_VERSION=`git describe --tags` # XXX # Sync the ddoc npm start @@ -89,7 +104,7 @@ assert "$LINENO: Unable to load views." # Ensure _design/app exists res=`curl -s -w "%{http_code}" -X PUT -d '{}' $registry/_design/app -o /dev/null` assert "$LINENO: Unable to connect to $host." if [ "$res" != "$CREATED" ] && [ "$res" != "$CONFLICT" ]; then fail "$LINENO: Unable to create _design/app document. Server responded with status code $res"; fi # Install app npm run copy -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,26 +5,26 @@ SCRIPTPATH=`cd $(dirname $0) ; pwd -P` function assert { if [ "$?" != "0" ]; then fail "${1:-"An unknown error occurred."}"; fi } function fail { clean echo "$BASEDIR: $1" 1>&2 exit 1 } function clean { npm set _npmjs.org:couch= # Only try to clean up files if we made it past cloning if [ "$SCRIPTPATH" != `pwd` ]; then cd ../; rm -rf npmjs.org; fi } -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 48 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,34 @@ #!/bin/bash BASEDIR=`basename $0` SCRIPTPATH=`cd $(dirname $0) ; pwd -P` function assert { if [ "$?" != "0" ]; then fail "${1:-"An unknown error occurred."}"; fi } function fail { clean echo "$BASEDIR: $1" 1>&2 exit 1 } function clean { npm set _npmjs.org:couch= # Only try to clean up files if we made it past cloning if [ "$SCRIPTPATH" != `pwd` ]; then cd ../; rm -rf npmjs.org; fi } # Read hostname echo -n "Hostname [localhost:5984]: " read hostname @@ -30,28 +59,40 @@ echo # Per: https://github.com/npm/npmjs.org # Get the npm app from github git clone [email protected]:npm/npmjs.org.git assert "$LINENO: Unable to clone npmjs.org." cd npmjs.org npm install assert "$LINENO: npm install failed." # Set the registry for use by the upcoming scripts registry=http://$username:$password@$hostname/$database npm set _npmjs.org:couch=$registry # Create the database res=`curl -s -w "%{http_code}" -X PUT $registry -o /dev/null` assert "$LINENO: Unable to connect to $host." if [ "$res" != "201" ]; then fail "$LINENO: Unable to create database \"$database\". Server responded with status code $res"; fi # Sync the ddoc npm start assert "$LINENO: npm start failed." # Load views npm run load assert "$LINENO: Unable to load views." # Ensure _design/app exists res=`curl -s -w "%{http_code}" -X PUT -d '{}' $registry/_design/app -o /dev/null` assert "$LINENO: Unable to connect to $host." if [ "$res" != "201" ]; then fail "$LINENO: Unable to create _design/app document. Server responded with status code $res"; fi # Install app npm run copy assert "$LINENO: Unable to install couch app." clean -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,41 @@ #!/bin/bash # Read hostname echo -n "Hostname [localhost:5984]: " read hostname if [ -z $hostname ]; then hostname="localhost:5984"; fi # Read DB name echo -n "Database Name [registry]: " read database if [ -z $database ]; then database="registry"; fi # Read Username echo -n "CouchDB Username [admin]: " read username if [ -z $username ]; then username="admin"; fi # Read Password echo -n "CouchDB Password: " read -s password echo echo # Per: https://github.com/npm/npmjs.org git clone [email protected]:npm/npmjs.org.git cd npmjs.org npm install # Create the database registry=http://$username:$password@$hostname/$database curl -X PUT $registry npm set _npmjs.org:couch=$registry -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ; CouchDB Config ; Drop in PREFIX/local.d/npmjs.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ ; CouchDB Config ; Drop in PREFIX/local.d/npm.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ; Drop in COUCHDB_PREFIX/local.d/npm.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ; Drop in $COUCHDB_PREFIX/local.d/npm.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ; Drop in $PREFIX/local.d/npm.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik renamed this gist
Feb 22, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
totherik renamed this gist
Feb 22, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ; $PREFIX/local.d/npm.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ ; $PREFIX/local.d/registry.ini [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev users_db_public = true -
totherik revised this gist
Feb 22, 2014 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ [couch_httpd_auth] public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev users_db_public = true [httpd] secure_rewrites = false [couchdb] delayed_commits = false -
totherik created this gist
Feb 22, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ #!/bin/bash # Read DB name echo -n "Database Name [registry]: " read database if [ -z $database ]; then database="registry"; fi # Read Username echo -n "CouchDB Username [admin]: " read username if [ -z $username ]; then username="admin"; fi # Read Password echo -n "CouchDB Password: " read -s password echo echo # Per: https://github.com/npm/npmjs.org git clone [email protected]:npm/npmjs.org.git cd npmjs.org npm install # Create the database registry=http://$username:$password@localhost:5984/$database curl -X PUT $registry npm set _npmjs.org:couch=$registry # Sync the ddoc npm start # Load views npm run load # Ensure _design/app exists curl -s -H 'Accept: application/json' -X PUT -d '{}' $registry/_design/app > /dev/null # Install app npm run copy # Clean up npm set _npmjs.org:couch= cd ../ rm -rf npmjs.org