Skip to content

Instantly share code, notes, and snippets.

@l-vincent-l
Created April 5, 2017 15:21
Show Gist options
  • Save l-vincent-l/5b4cd21b7edbc436313c4351007be8ae to your computer and use it in GitHub Desktop.
Save l-vincent-l/5b4cd21b7edbc436313c4351007be8ae to your computer and use it in GitHub Desktop.
Install & run transitland
#!/usr/bin/env bash
git clone https://github.com/transitland/transitland-datastore
transitland-datastore/bin/setup
cd transitland-datastore
read -p "Postgresql user: " dbuser
read -s -p "Postgresql password: " dbpass
echo "" > config/database.yml
echo "default: &default" >> config/database.yml
echo " adapter: postgis" >> config/database.yml
echo " encoding: unicode" >> config/database.yml
echo " pool: 5" >> config/database.yml
echo " schema_search_path: public" >> config/database.yml
echo " hostname: localhost" >> config/database.yml
echo "" >> config/database.yml
echo "development:" >> config/database.yml
echo " <<: *default" >> config/database.yml
echo " database: transitland_datastore_development" >> config/database.yml
echo " user: $dbuser" >> config/database.yml
echo " password: $dbpass" >> config/database.yml
bundle exec rake db:create
bundle exec rake db:setup
echo "" > Procfile
echo "sidekiq: bundle exec sidekiq" >> Procfile
echo "web: bundle exec rails server -p 3000" >> Procfile
cd ..
git clone https://github.com/transitland/feed-registry.git
cd feed-registry
npm install
node_modules/.bin/bower install
cat config/environment.js | sed -e "s/datastoreHost=\(.\)*/datastoreHost=\ 'http:\/\/localhost:3000',/" > config/environment.js.bak
cp config/environment.js.bak config/environment.js
cat config/environment.js | sed -e "s/datastoreHost:\(.\)*/datastoreHost:\ 'http:\/\/localhost:3000',/" > config/environment.js.bak
cp config/environment.js.bak config/environment.js
cat config/environment.js | sed -e "s/datastoreHost\ =\(.\)*/datastoreHost=\ 'http:\/\/localhost:3000',/" > config/environment.js.bak
cp config/environment.js.bak config/environment.js
cd ..
transitdir=$(readlink -f transitland-datastore)
echo "" > Procfile
echo "datastore: foreman start -d $transitdir" >> Procfile
echo "feed-registry: cd feed-registry && ember serve" >> Procfile
foreman start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment