{"id":18648251,"url":"https://github.com/capistrano/symfony","last_synced_at":"2025-05-16T05:00:17.604Z","repository":{"id":14518961,"uuid":"17232918","full_name":"capistrano/symfony","owner":"capistrano","description":"Capistrano tasks for deploying the Symfony standard edition","archived":false,"fork":false,"pushed_at":"2020-08-06T17:04:45.000Z","size":63,"stargazers_count":354,"open_issues_count":16,"forks_count":61,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-09T10:17:47.831Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/capistrano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-27T01:57:02.000Z","updated_at":"2025-04-24T21:47:20.000Z","dependencies_parsed_at":"2022-07-22T12:49:26.522Z","dependency_job_id":null,"html_url":"https://github.com/capistrano/symfony","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fsymfony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fsymfony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fsymfony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fsymfony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capistrano","download_url":"https://codeload.github.com/capistrano/symfony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"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":[],"created_at":"2024-11-07T06:29:50.807Z","updated_at":"2025-05-16T05:00:17.417Z","avatar_url":"https://github.com/capistrano.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capistrano::Symfony\n\nSymfony 4 specific tasks for Capistrano v3 (inspired by [capifony][2]).\n\nIt leverages the following capistrano tasks to deploy a Symfony app\n\n* https://github.com/capistrano/composer\n* https://github.com/capistrano/file-permissions\n\n## Version information\n\n#### Version 1.x\n\nThis version is built for **Symfony 2 and 3**. \n\nGo to [Version 1 documentation](/../../tree/1.x). \n\n#### Version 2.x\n\nThis version is built for **Symfony 4**. \n\nYou are currently on the Version 2 branch. \n\n## Installation\n\nSpecify your dependencies: \n```\n# Gemfile\nsource 'https://rubygems.org'\ngem 'capistrano',  '~\u003e 3.11'\ngem 'capistrano-symfony', '~\u003e 2.0.0'\n```\n\nInstall your dependencies: \n```\nbundle install\n```\n\nWhen `capistrano` and `capistrano-symfony` is installed. Run the following command\nto set up your local files:\n\n```\ncap install\n```\n\nMake Capistrano aware of `'capistrano/symfony'` by requiring capistrano-symfony in your\nnew Capfile after `require \"capistrano/deploy\"`.\n\n```ruby\n# Capfile\n# ...\nrequire \"capistrano/symfony\"\n```\n\nIf you use composer you might want this:\n```\nrequire \"capistrano/composer\"\n```\n\n## Usage\n\n```\ncap staging deploy\ncap production deploy\n```\n\n### Settings\n\nIf you are using a standard Symfony Flex application that follows the best practises \nthen you do not need to change/add anything to your `deploy.rb` other than what is \nrequired from Capistrano.\n\nWe do however expose the following settings (shown with default evaluated values) \nthat can be modified to suit your project. Please refer to `lib/capistrano/symfony/defaults.rb` \nto see exactly how the defaults are set up.\n\n\n```ruby\n\n# symfony-standard edition directories\nset :bin_path, \"bin\"\nset :config_path, \"config\"\nset :var_path, \"var\"\nset :web_path, \"public\"\n\n# The next settings are lazily evaluated from the above values, so take care\n# when modifying them\nset :log_path, \"var/log\"\nset :cache_path, \"var/cache\"\n\nset :symfony_console_path, \"bin/console\"\nset :symfony_console_flags, \"--no-debug\"\n\n# asset management\nset :assets_install_path, \"public\"\nset :assets_install_flags,  '--symlink'\n\n# Share files/directories between releases\nset :linked_dirs, [\"var/log\"]\nset :linked_files, []\n# To use a .env file:\n#set :linked_files, [\".env\"]\n\n# Set correct permissions between releases, this is turned off by default\nset :file_permissions_paths, [\"var\"]\nset :permission_method, false\n\n# Role filtering\nset :symfony_roles, :all\nset :symfony_deploy_roles, :all\n\n# Add extra environment variables: \nset :default_env, {\n 'APP_ENV' =\u003e 'prod'\n 'SECRET' =\u003e 'foobar'\n}\n```\n\n### Flow\n\ncapistrano-symfony hooks into the [flow][1] offered by capistrano. It adds to that flow like so\n\n* `symfony:create_cache_dir`\n* `symfony:set_permissions`\n* `symfony:cache:warmup`\n\n```\ndeploy\n|__ deploy:starting\n|   |__ [before]\n|   |   |__ deploy:ensure_stage\n|   |   |__ deploy:set_shared_assets\n|   |__ deploy:check\n|__ deploy:started\n|__ deploy:updating\n|   |__ git:create_release\n|   |__ deploy:symlink:shared\n|   |__ symfony:create_cache_dir\n|   |__ symfony:set_permissions\n|   |__ symfony:make_console_executable\n|__ deploy:updated\n|   |__ symfony:cache:warmup\n|__ deploy:publishing\n|   |__ deploy:symlink:release\n|   |__ deploy:restart\n|__ deploy:published\n|__ deploy:finishing\n|   |__ deploy:cleanup\n|__ deploy:finished\n    |__ deploy:log_revision\n```\n\n### File permissions\n\nSet the `permission_method` variable to one of `:chmod`, `:acl`, or `:chgrp` in\nyour `deploy.rb` to handle the common scenario of a web user and the deploy user\nbeing different.\n\nBoth will need access to the files/directories such as `var/cache` and `public/uploads`\n(if you handle uploads). Set `file_permissions_users` to your webserver user\n\nExample:\n\n```\n# deploy.rb\n\nset :permission_method, :acl\nset :file_permissions_users, [\"nginx\"]\nset :file_permissions_paths, [\"var\", \"public/uploads\"]\n```\n\n**Note:** Using `:acl` requires that `setfacl` be available on your deployment target.\n**Note:** If you are getting an error like `setfacl: Option -m: Invalid argument near character 3`,  \nit means that the users in `file_permissions_users` do not exist on your deployment\ntarget.\n\n\n\nSee [the symfony documentation](http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup)\nand [the file permission capistrano plugin](https://github.com/capistrano/file-permissions) for reference.\n\n### Integrated common tasks\n\nThe following common tasks are available:\n\n* `symfony:assets:install`\n\nSo you can use them with hooks in your project's `deploy.rb` like this:\n\n```ruby\nafter 'deploy:updated', 'symfony:assets:install'\nbefore 'deploy:updated', 'symfony:build_bootstrap'\n```\n\n### Using the Symfony console\n\nA task wrapping the symfony console is provided, making it easy to create tasks\nthat call console methods.\n\nFor example if you have installed the [DoctrineMigrationsBundle][3] in your\nproject you may want to run migrations during a deploy.\n\n```ruby\nnamespace :deploy do\n  task :migrate do\n    symfony_console('doctrine:migrations:migrate', '--no-interaction')\n  end\nend\n```\n\nIf you want to execute a command on a host with a given role you can use the Capistrano\n`on` DSL, additionally using `within` from Capistrano will change the directory\n\n```ruby\nnamespace :deploy do\n  task :migrate do\n    on roles(:db) do\n      symfony_console('doctrine:migrations:migrate', '--no-interaction')\n    end\n  end\nend\n```\n\n### Using composer\n\nIf you use composer you can install `capistrano/composer`. Here are some short \ninstructions. Read more at [capistrano/composer](https://github.com/capistrano/composer).\n\nFirst run the following command to download the library: \n\n```\ngem install capistrano-composer\n```\n\nThen make sure your Capfile includes the following: \n\n```\nrequire 'capistrano/composer'\n```\n\nTo download the composer.phar executable add the following to your `deploy.rb`:\n\n```\n# First define deploy target: \nset :deploy_to, \"/home/sites/com.example\"\n\n# Install composer if it does not exist\nSSHKit.config.command_map[:composer] = \"php #{shared_path.join(\"composer.phar\")}\"\n\nnamespace :deploy do\n  after :starting, 'composer:install_executable'\nend\n```\n\n[1]: http://capistranorb.com/documentation/getting-started/flow/\n[2]: http://capifony.org/\n[3]: http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapistrano%2Fsymfony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapistrano%2Fsymfony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapistrano%2Fsymfony/lists"}