Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicolai86/ansible-rails-deployment
deploy projects using ansible
https://github.com/nicolai86/ansible-rails-deployment
ansible capistrano deployment rails-deployment
Last synced: 3 months ago
JSON representation
deploy projects using ansible
- Host: GitHub
- URL: https://github.com/nicolai86/ansible-rails-deployment
- Owner: nicolai86
- License: mit
- Archived: true
- Created: 2013-12-27T11:31:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-21T05:24:28.000Z (almost 9 years ago)
- Last Synced: 2024-07-29T09:36:06.411Z (3 months ago)
- Topics: ansible, capistrano, deployment, rails-deployment
- Language: Python
- Size: 55.7 KB
- Stars: 77
- Watchers: 3
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list-ansible - ansible-rails-deployment
README
# rails-deployment
A role that executes common tasks when deploying ruby on rails applications.
Depends on [prepare-release][1] and [finalize-release][2] roles to checkout a new
version from your git versioned application.example usage:
---
- hosts: server
user: app
gather_facts: False
vars:
user: app
home_directory: "/home/{{ user }}"
rails_env: "staging"
deploy_to: "{{ home_directory }}"roles:
-
role: nicolai86.prepare-releaserepo: [email protected]:app
branch: developsymlinks:
- { src: "{{ shared_path }}/vendor/bundle", dest: "{{ build_path }}/vendor/bundle" }
- { src: "{{ shared_path }}/public/assets", dest: "{{ build_path }}/public/assets" }
- { src: "{{ shared_path }}/log", dest: "{{ build_path }}/log" }
- { src: "{{ shared_path }}/.env", dest: "{{ build_path }}/.env" }
- { src: "{{ shared_path }}/config/database.yml", dest: "{{ build_path }}/config/database.yml" }directories:
- "{{ shared_path }}/config"templates:
- { src: "templates/env.js", dest: "{{ shared_path }}/.env" }tags: deploy
-
role: nicolai86.rails-deploymentmigrate: yes
compile_assets: yes
force_migrate: no
force_asset_compilation: notags: deploy
-
role: nicolai86.finalize-releasetags: deploy
-
role: restartservice: application:*
tags:
- deploy
- rollback#### configuration
Most parts of the role can be configured using variables. For example, if you are using rails but using SQL for schema management,
you can easily configure rails-deployment to compare the structure.sql files instead of schema.rb like this:-
role: nicolai86.rails-deploymentmigrate: yes
migrate_diff_paths:
- { current: "{{ current_path }}/db/structure.sql", next: "{{ build_path }}/db/structure.sql" }See defaults/main.yml for details about available variables.
#### requirements
- all gem binaries (e.g. bundle, rake, rails) need to be locateable using the $PATH. Make sure to setup properly
If you are using rbenv to manage your ruby version make sure to properly set the environment using
something like this:```
environment:
PATH: '~/.rbenv/shims:~/.rbenv/bin:"$PATH"'
```#### important features:
- it can be reused multiple times inside a single playbook for separate deployments.
- works with rvm, rbenv or system ruby installations.
- it's using a bare copy of the repository to deploy.
- migration and asset compilation can be de-activated as needed.
- only keeps 5 most recent deployments per default#### limitations
- you need to write your own restart handling
[1]:https://github.com/nicolai86/ansible-prepare-release
[2]:https://github.com/nicolai86/ansible-finalize-release
[3]:https://github.com/nicolai86/ansible-rails