mirror of https://github.com/mastodon/mastodon
Add dev_start.sh to let people get a development environment started quickly
This commit is contained in:
parent
26287b6e7d
commit
295fc0e612
|
@ -22,3 +22,5 @@ public/assets
|
||||||
.env.*
|
.env.*
|
||||||
node_modules/
|
node_modules/
|
||||||
neo4j/
|
neo4j/
|
||||||
|
.secret.keybase
|
||||||
|
.secret.paperclip
|
||||||
|
|
|
@ -6,7 +6,11 @@ default: &default
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: mastodon_development
|
database: <%= ENV['DB_DEV_NAME'] || 'mastodon_development' %>
|
||||||
|
username: <%= ENV['DB_USER'] || 'mastodon' %>
|
||||||
|
password: <%= ENV['DB_PASS'] || '' %>
|
||||||
|
host: <%= ENV['DB_HOST'] || 'localhost' %>
|
||||||
|
port: <%= ENV['DB_PORT'] || 5432 %>
|
||||||
|
|
||||||
# Warning: The database defined as "test" will be erased and
|
# Warning: The database defined as "test" will be erased and
|
||||||
# re-generated from your development database when you run "rake".
|
# re-generated from your development database when you run "rake".
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
export REDIS_HOST=localhost
|
||||||
|
export REDIS_PORT=6379
|
||||||
|
export DB_HOST=localhost
|
||||||
|
export DB_USER=postgres
|
||||||
|
export DB_DEV_NAME=postgres
|
||||||
|
export DB_PASS=postgres
|
||||||
|
export DB_PORT=5432
|
||||||
|
|
||||||
|
# Federation
|
||||||
|
export LOCAL_DOMAIN=localhost
|
||||||
|
export LOCAL_HTTPS=false
|
||||||
|
|
||||||
|
# Application secrets
|
||||||
|
if [ ! -f .secret.paperclip ]; then
|
||||||
|
echo "$(rake secret)" > .secret.paperclip
|
||||||
|
fi
|
||||||
|
if [ ! -f .secret.keybase ]; then
|
||||||
|
echo "$(rake secret)" > .secret.keybase
|
||||||
|
fi
|
||||||
|
export PAPERCLIP_SECRET=$(<.secret.paperclip)
|
||||||
|
export SECRET_KEY_BASE=$(<.secret.keybase)
|
||||||
|
|
||||||
|
# E-mail configuration
|
||||||
|
export SMTP_SERVER=smtp.mailgun.org
|
||||||
|
export SMTP_PORT=587
|
||||||
|
export SMTP_LOGIN=
|
||||||
|
export SMTP_PASSWORD=
|
||||||
|
export SMTP_FROM_ADDRESS=notifications@example.com
|
||||||
|
|
||||||
|
# Set the rails environment to development.
|
||||||
|
export RAILS_ENV=development
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
#bundle install
|
||||||
|
|
||||||
|
# Install Node.js dependencies
|
||||||
|
if [ ! -d node_modules ]; then
|
||||||
|
yarn
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Upgrade database
|
||||||
|
rails db:migrate
|
||||||
|
|
||||||
|
# Compile assets; if you set RAILS_ENV to production, you
|
||||||
|
# need to uncomment this line.
|
||||||
|
#rails assets:precompile
|
||||||
|
|
||||||
|
# Run web server
|
||||||
|
rails server
|
Loading…
Reference in New Issue