{"id":21878302,"url":"https://github.com/pepabo/capistrano-stretcher","last_synced_at":"2026-03-16T04:32:36.123Z","repository":{"id":59151888,"uuid":"46543729","full_name":"pepabo/capistrano-stretcher","owner":"pepabo","description":"capistrano task for stretcher","archived":false,"fork":false,"pushed_at":"2018-04-16T02:55:18.000Z","size":40,"stargazers_count":21,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T21:04:02.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/pepabo.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":"2015-11-20T06:23:56.000Z","updated_at":"2019-07-11T20:44:41.000Z","dependencies_parsed_at":"2022-09-16T21:22:06.891Z","dependency_job_id":null,"html_url":"https://github.com/pepabo/capistrano-stretcher","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fcapistrano-stretcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fcapistrano-stretcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fcapistrano-stretcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fcapistrano-stretcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/capistrano-stretcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226881093,"owners_count":17696894,"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-28T08:12:15.124Z","updated_at":"2026-03-16T04:32:36.058Z","avatar_url":"https://github.com/pepabo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capistrano::Stretcher\n\ncapistrano task for stretcher.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'capistrano-stretcher'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install capistrano-stretcher\n\n## Requirements\n\ncapistrano-stretcher requires target server for building to application assets. This server should be installed the following packages:\n\n * git\n * rsync\n * tar\n * gzip\n * awk\n * openssl\n * aws-cli\n * consul\n * pv\n\ntarget server builds assets, uploads assets to AWS S3 and invokes `consul event` automatically. So target server can access AWS s3 via aws-cli and join your deployment consul cluster.\n\nIf you want to use non-s3 (e.g. private DC), upload assets to your server with rsync and download from http(s).\n\n## Usage\n\nYou need to add `require \"capistrano/stretcher\"` to Capfile and add `config/deploy.rb` following variables:\n\n```ruby\nrole :build, ['your-target-server.lan'], :no_release =\u003e true\n\n# If your build server is accessible to consul cluster, then set the same server\n# If different, set a server that can access consul cluster\n# just to kick consul event!\nrole :consul, ['your-target-server.lan'], :no_release =\u003e true\n\nset :application, 'your-application'\nset :deploy_to, '/var/www'\nset :deploy_roles, 'www,batch'\nset :stretcher_hooks, 'config/stretcher.yml.erb'\nset :local_tarball_name, 'rails-applicaiton.tar.gz'\nset :stretcher_src, \"s3://your-deployment-bucket/assets/rails-application-#{env.now}.tgz\"\nset :manifest_path, \"s3://your-deployment-bucket/manifests/\"\n# Optional, if you want to use mv\nset :stretcher_sync_strategy, \"mv\"\n\n# Optinal, if you want to http(s) in stretcher_src, manifest_path\nset :rsync_ssh_option, \"-p 22\"\nset :rsync_ssh_user, \"MY_USER\" # if undefined, use current user on build server\nset :rsync_host, \"xxx.xxx.xxx.xxx\"\nset :rsync_stretcher_src_path, \"/var/www/resource/assets/rails-application-#{env.now}.tgz\"\nset :rsync_manifest_path,      \"/var/www/resource/manifests\"\n```\n\nand write hooks for stretcher to `config/stretcher.yml.erb`\n\n```yaml\ndefault: \u0026default\n  pre:\n    -\n  success:\n    -\n  failure:\n    - cat \u003e\u003e /tmp/failure\nwww:\n  \u003c\u003c: *default\n  post:\n    - ln -nfs \u003c%= fetch(:deploy_to) %\u003e/shared/data \u003c%= fetch(:deploy_to) %\u003e/current/data\n    - sudo systemctl reload unicorn\nbatch:\n  \u003c\u003c: *default\n  post:\n    - ln -nfs \u003c%= fetch(:deploy_to) %\u003e/shared/data \u003c%= fetch(:deploy_to) %\u003e/current/data\n```\n\nabove hooks is extracted to manifest.yml for stretcher. If you have \"www,batch\" roles and stages named staging and production, capistrano-stretcher extract to following yaml from configuration.\n\n * `manifest_www_staging.yml`\n * `manifest_batch_staging.yml`\n\nand invoke\n\n * `consul event -name deploy_www_staging s3://.../manifest_www.yml`\n * `consul event -name deploy_batch_staging s3://.../manifest_batch.yml`\n\nwith `cap staging stretcher:deploy` command on target server. When it's invoked with `cap production stretcher:deploy`, capistrano-stretcher replace suffix `staging` to `production`.\n\n## Related Projects\n\n * [capistrano-stretcher-rails](https://github.com/pepabo/capistrano-stretcher-rails)\n * [capistrano-stretcher-npm](https://github.com/pepabo/capistrano-stretcher-npm)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pepabo/capistrano-stretcher.\n\n## LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2015- GMO Pepabo, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fcapistrano-stretcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Fcapistrano-stretcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fcapistrano-stretcher/lists"}