Install PostgreSQL and Elixir, then:
By default SinetrisBlog connect to a localhost postgresql database
named sinetris_blog_dev
with the username postgresql
and the password
postgresql
.
Create this database/user if not already done:
CREATE USER postgres;
ALTER USER postgres PASSWORD 'postgres';
- Install dependencies with
mix deps.get
- Create the database with
mix ecto.create Repo
- Run all migration with
mix ecto.migrate Repo
- Create a user:
~ $ iex -S mix
...
iex(1)> SinetrisBlog.User.create(%{username: "my-username", email: "[email protected]", password: "my-password"})
- And finally start Phoenix router with
mix phoenix.start
Now you can visit http://localhost:4000 from your browser.
Do not edit the files in priv/static/css/styles.css
or your changes will be lost.
You should instead modify the files in sass/
To generate the css files you have to:
- Install
bundler
withgem install bundler
- Install Compass with
bundle install
- Compile the CSS with
bundle exec compass compile
You need to download Selenium and start it:
java -jar selenium-server-standalone-2.42.2.jar
Fetch the test dependencies using:
MIX_ENV=test mix do deps.get
and then exec the tests:
mix test
- Create or configure an Heroku app.
- Set the
SESSION_SECRET
. - push the app to Heroku
- Execute database migrations.
- Create a user.
To create a new Heroku app, use:
heroku apps:create --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
To configure an existing Heroku app:
heroku config:set BUILDPACK_URL="https://github.com/HashNuke/heroku-buildpack-elixir.git"
Set the MIX_ENV
to prod:
heroku config:set MIX_ENV=prod
Set the SESSION_SECRET
:
heroku config:set SESSION_SECRET="must be at least 64 characters long"
Push to Heroku:
git push heroku master
Migrate:
heroku run mix ecto.migrate Repo
Create a user:
~ $ heroku run bash
Running `bash` attached to terminal...
~ $ iex -S mix
...
iex(1)> SinetrisBlog.User.create(%{username: "my-username", email: "[email protected]", password: "my-password"})
- Fork this repo
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a Pull Request from your branch
- That's it!
Copyright (c) 2014 Duilio Ruggiero. Code released under the MIT license.