{"id":18648271,"url":"https://github.com/capistrano/drupal-deploy","last_synced_at":"2025-04-11T13:31:14.313Z","repository":{"id":31336963,"uuid":"34899614","full_name":"capistrano/drupal-deploy","owner":"capistrano","description":" Gem for deploying Drupal projects with capistrano 3","archived":false,"fork":false,"pushed_at":"2020-06-19T20:37:05.000Z","size":16,"stargazers_count":40,"open_issues_count":6,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-03-25T19:58:43.076Z","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.markdown","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":"2015-05-01T11:15:40.000Z","updated_at":"2023-10-13T20:41:12.000Z","dependencies_parsed_at":"2022-09-09T07:00:23.188Z","dependency_job_id":null,"html_url":"https://github.com/capistrano/drupal-deploy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fdrupal-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fdrupal-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fdrupal-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capistrano%2Fdrupal-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capistrano","download_url":"https://codeload.github.com/capistrano/drupal-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470153,"owners_count":17150505,"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:58.027Z","updated_at":"2024-11-07T06:29:58.660Z","avatar_url":"https://github.com/capistrano.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capistrano::DrupalDeploy\n\nDeploy [Drupal](https://www.drupal.org/) with [Capistrano v3](http://capistranorb.com/). This gem is a pluging for capistrano that provide a number of tasks specific to Drupal. For the moment support only Drupal 7.\n\nIf you are new to capistrano check the [Capistrano 3 documentation](http://capistranorb.com/).\n\n## Installation\n[gems](http://rubygems.org) must be installed on your system first.\n\nAdd this line to your application's Gemfile:\n\n```ruby\nsource 'https://rubygems.org'\ngroup :development do\n    gem 'capistrano-drupal-deploy', '~\u003e 0.0.2'\nend\n```\n\nAnd then execute:\n\n    $ bundle\n    $ bundle exec cap install\n\nOr install it yourself as:\n\n    $ gem install capistrano-drupal-deploy\n    $ cap install\n\n## Usage\t\n\nRequire the module in your `Capfile`:\n\n```ruby\nrequire 'capistrano/drupal-deploy'\n# Composer is needed to install drush on the server\nrequire 'capistrano/composer'\n```\n\n### Configuration\n\nEdit `config/deploy.rb` to set the global parameters. You should at least edit your app_name and your repo_url.\n\n```ruby\n set :application, 'my app name'\n set :repo_url, 'git@example.com:me/my_repo.git'\n```\n\n*Capistrano drupal deploy* makes the following configuration variables available\n\n```ruby\n# Path to the drupal directory, default to app.\nset :app_path,        \"app\"\n```\n\nDrupal need settings.php and, files and private-files shared accross deploy\n\n```ruby\n# Link file settings.php\nset :linked_files, fetch(:linked_files, []).push('app/sites/default/settings.php')\n\n# Link dirs files and private-files\nset :linked_dirs, fetch(:linked_dirs, []).push('app/sites/default/files', 'private-files')\n```\n\n\nComposer and drush need to be mapped\n\n```ruby\n# Remove default composer install task on deploy:updated\nRake::Task['deploy:updated'].prerequisites.delete('composer:install')\n\n# Map composer and drush commands\n# NOTE: If stage have different deploy_to\n# you have to copy those line for each \u003cstage_name\u003e.rb\n# See https://github.com/capistrano/composer/issues/22\nSSHKit.config.command_map[:composer] = \"#{shared_path.join(\"composer.phar\")}\"\nSSHKit.config.command_map[:drush] = \"#{shared_path.join(\"vendor/bin/drush\")}\"\n```\n\t\nConfigure each stage in config/deploy/\u003cstage_name\u003e.rb. Overwrite global settings if needed.\n\n```ruby\n# server-based syntax\n# ======================\n# Defines a single server with a list of roles and multiple properties.\n# You can define all roles on a single server, or split them:\n\n# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value\n\n# overwrite deploy_to\nset :deploy_to, '/var/www/stage_name/my_app'\n\n# set a branch for this release\nset :branch, 'dev'\n```\n\n\n\t\nFor more information about configuration http://capistranorb.com/\n\n\n## Deployment\n\nRun deploy\n\n\t$ cap \u003cstage_name\u003e deploy\n\nAfter a couple of commands, it will fail with this error:\n\n\tFinished in 0.067 seconds with exit status 1 (failed).\n\tERROR linked file /var/www/stage_name/my_app/shared/app/sites/default/settings.php does not exist on staging.mysite.com\n\t\nAs expected, Capistrano has been told to link your settings.php file, but it can’t find it on the server where it expects. We need to manually upload that file now. If we look at the app directory on our server, it now contains two folders releases and shared. Inside of the shared directory you will find a app/sites/default directory. You will need to create your settings.php file into that directory.\n\nOn the server your webserver user (eg. www-data) need to has the right to write in\n\n\t/var/www/stage_name/my_app/shared/app/sites/default/files\n\t/var/www/stage_name/my_app/shared/private-files\n\nOnce this is done, try and deploy again. If everything goes well, Capistrano will clone your app from your repository and work the rest.\n\nNow, every time you want to deploy your app\n\n\t$ cap deploy\n\nSome command use drush. To install drush on your server\n\n\t$ cap composer:install_executable\n\t$ cap drush:install\n\n\nIf you want to deploy your app and also revert features, clear cache\n\n\t$ cap deploy:full\n\t\nAnd if some troubles occur, just launch the rollback command to return to the previous release.\n\n\t$ cap deploy:rollback\n\n\nYou should then be able to proceed as you would usually, you may want to familiarise yourself with the truncated list of tasks, you can get a full list with:\n\n    $ cap -T\n    \nThis show a list of all avaible commands:\n\n    \n\tcap composer:install               # Install the project dependencies via Composer\n\tcap composer:install_executable    # Installs composer.phar to the shared directory\n\tcap composer:self_update           # Run the self-update command for composer.phar\n\tcap deploy                         # Deploy a new release\n\tcap deploy:check                   # Check required files and directories exist\n\tcap deploy:check:directories       # Check shared and release directories exist\n\tcap deploy:check:linked_dirs       # Check directories to be linked exist in shared\n\tcap deploy:check:linked_files      # Check files to be linked exist in shared\n\tcap deploy:check:make_linked_dirs  # Check directories of files to be linked exist in shared\n\tcap deploy:cleanup                 # Clean up old releases\n\tcap deploy:cleanup_rollback        # Remove and archive rolled-back release\n\tcap deploy:finished                # Finished\n\tcap deploy:finishing               # Finish the deployment, clean up server(s)\n\tcap deploy:finishing_rollback      # Finish the rollback, clean up server(s)\n\tcap deploy:full                    # Deploy your project and do an updatedb, feature revert, cache clear..\n\tcap deploy:log_revision            # Log details of the deploy\n\tcap deploy:published               # Published\n\tcap deploy:publishing              # Publish the release\n\tcap deploy:restart                 # Restart application\n\tcap deploy:revert_release          # Revert to previous release timestamp\n\tcap deploy:reverted                # Reverted\n\tcap deploy:reverting               # Revert server(s) to previous release\n\tcap deploy:rollback                # Rollback to previous release\n\tcap deploy:set_current_revision    # Place a REVISION file with the current revision SHA in the current release path\n\tcap deploy:started                 # Started\n\tcap deploy:starting                # Start a deployment, make sure server(s) ready\n\tcap deploy:symlink:linked_dirs     # Symlink linked directories\n\tcap deploy:symlink:linked_files    # Symlink linked files\n\tcap deploy:symlink:release         # Symlink release to current\n\tcap deploy:symlink:shared          # Symlink files and directories from shared to release\n\tcap deploy:updated                 # Updated\n\tcap deploy:updating                # Update server(s) by setting up a new release\n\tcap drupal:backupdb                # Backup the database using backup and migrate\n\tcap drupal:cache:clear             # Clear all caches\n\tcap drupal:cli                     # Open an interactive shell on a Drupal site\n\tcap drupal:drush                   # Run any drush command\n\tcap drupal:feature_revert          # Revert feature\n\tcap drupal:logs                    # Show logs\n\tcap drupal:requirements            # Provides information about things that may be wrong in your Drupal installation, if any\n\tcap drupal:site_offline            # Set the site offline\n\tcap drupal:site_online             # Set the site online\n\tcap drupal:update:pm_updatestatus  # Show a report of available minor updates to Drupal core and contrib projects\n\tcap drupal:update:updatedb         # Apply any database updates required (as with running update.php)\n\tcap drupal:update:updatedb_status  # List any pending database updates\n\tcap drush:install                  # Install Drush\n\tcap files:download                 # Download drupal sites files (from remote to local)\n\tcap files:upload                   # Upload drupal sites files (from local to remote)\n\tcap install                        # Install Capistrano, cap install STAGES=staging,production\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapistrano%2Fdrupal-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapistrano%2Fdrupal-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapistrano%2Fdrupal-deploy/lists"}