{"id":13752912,"url":"https://github.com/nicolai86/ansible-rails-deployment","last_synced_at":"2026-01-10T20:52:25.401Z","repository":{"id":12798741,"uuid":"15472569","full_name":"nicolai86/ansible-rails-deployment","owner":"nicolai86","description":"deploy projects using ansible","archived":true,"fork":false,"pushed_at":"2016-01-21T05:24:28.000Z","size":57,"stargazers_count":76,"open_issues_count":1,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T18:56:48.540Z","etag":null,"topics":["ansible","capistrano","deployment","rails-deployment"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicolai86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-27T11:31:21.000Z","updated_at":"2024-09-20T20:08:25.000Z","dependencies_parsed_at":"2022-09-13T08:32:10.243Z","dependency_job_id":null,"html_url":"https://github.com/nicolai86/ansible-rails-deployment","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolai86%2Fansible-rails-deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolai86%2Fansible-rails-deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolai86%2Fansible-rails-deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolai86%2Fansible-rails-deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolai86","download_url":"https://codeload.github.com/nicolai86/ansible-rails-deployment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321786,"owners_count":21890465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","capistrano","deployment","rails-deployment"],"created_at":"2024-08-03T09:01:12.539Z","updated_at":"2026-01-10T20:52:25.340Z","avatar_url":"https://github.com/nicolai86.png","language":"Python","funding_links":[],"categories":["rails-deployment"],"sub_categories":[],"readme":"# rails-deployment\n\nA role that executes common tasks when deploying ruby on rails applications.\n\nDepends on [prepare-release][1] and [finalize-release][2] roles to checkout a new\nversion from your git versioned application.\n\nexample usage:\n\n    ---\n    - hosts: server\n      user: app\n      gather_facts: False\n      vars:\n        user: app\n        home_directory: \"/home/{{ user }}\"\n        rails_env: \"staging\"\n        deploy_to: \"{{ home_directory }}\"\n\n      roles:\n        -\n          role: nicolai86.prepare-release\n\n          repo: git@example.com:app\n          branch: develop\n\n          symlinks:\n            - { src: \"{{ shared_path }}/vendor/bundle\", dest: \"{{ build_path }}/vendor/bundle\" }\n            - { src: \"{{ shared_path }}/public/assets\", dest: \"{{ build_path }}/public/assets\" }\n            - { src: \"{{ shared_path }}/log\", dest: \"{{ build_path }}/log\" }\n            - { src: \"{{ shared_path }}/.env\", dest: \"{{ build_path }}/.env\" }\n            - { src: \"{{ shared_path }}/config/database.yml\", dest: \"{{ build_path }}/config/database.yml\" }\n\n          directories:\n            - \"{{ shared_path }}/config\"\n\n          templates:\n            - { src: \"templates/env.js\", dest: \"{{ shared_path }}/.env\" }\n\n          tags: deploy\n\n        -\n          role: nicolai86.rails-deployment\n\n          migrate: yes\n          compile_assets: yes\n          force_migrate: no\n          force_asset_compilation: no\n\n          tags: deploy\n\n        -\n          role: nicolai86.finalize-release\n\n          tags: deploy\n\n        -\n          role: restart\n\n          service: application:*\n\n          tags:\n            - deploy\n            - rollback\n\n\n#### configuration\n\nMost parts of the role can be configured using variables. For example, if you are using rails but using SQL for schema management,\nyou can easily configure rails-deployment to compare the structure.sql files instead of schema.rb like this:\n\n    -\n      role: nicolai86.rails-deployment\n\n      migrate: yes\n\n      migrate_diff_paths:\n        - { current: \"{{ current_path }}/db/structure.sql\", next: \"{{ build_path }}/db/structure.sql\" }\n\nSee defaults/main.yml for details about available variables.\n\n#### requirements\n\n  - all gem binaries (e.g. bundle, rake, rails) need to be locateable using the $PATH. Make sure to setup properly\n\nIf you are using rbenv to manage your ruby version make sure to properly set the environment using\nsomething like this:\n\n```\nenvironment:\n  PATH: '~/.rbenv/shims:~/.rbenv/bin:\"$PATH\"'\n```\n\n#### important features:\n\n  - it can be reused multiple times inside a single playbook for separate deployments.\n  - works with rvm, rbenv or system ruby installations.\n  - it's using a bare copy of the repository to deploy.\n  - migration and asset compilation can be de-activated as needed.\n  - only keeps 5 most recent deployments per default\n\n#### limitations\n\n  - you need to write your own restart handling\n\n[1]:https://github.com/nicolai86/ansible-prepare-release\n[2]:https://github.com/nicolai86/ansible-finalize-release\n[3]:https://github.com/nicolai86/ansible-rails\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolai86%2Fansible-rails-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolai86%2Fansible-rails-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolai86%2Fansible-rails-deployment/lists"}