Deployment is handled via the capistrano gem.
This command deploys the master branch to the production server:
cap production deployThe staging server can be found at dev.pfadiolten.ch.
Deploy to it with the staging stage.
cap staging deployDevelopment is usually done in a docker container. Use the container with the following commands:
# (re)build the image
docker-compose build
# start the server
docker-compose up
# start the server in the background
docker-compose up -dIn development, Gems are mounted in a local docker volume.
This makes it possible to just run a single command when modifying
the Gemfile, instead of rebuilding the complete image.
# create the gem volume, only required once
docker volume create pfadiolten-home.gems
docker-compose run web bundleThis always has to be done before running the container for the first time.
The container saves its database in an external volume. It has to be created before first using the website:
docker volume create pfadiolten-home.dataAfterwards, the database has to be created and migrated.
docker-compose run web rails db:create db:migrateMigrations on an existing database don't require the db:create part.
docker-compose run web rails db:migrateAfterwards, the API should be available at localhost:3000.
The application requires access to a couple of APIs. Their respective access information can either be set with private credentials, or be copied from the deployment server.
PFADIOLTEN_OSM_ACCESS_TOKEN
PFADIOLTEN_INSTAGRAM_CLIENT_IDPFADIOLTEN_INSTAGRAM_CLIENT_SECRETPFADIOLTEN_INSTAGRAM_ACCESS_TOKEN