{"id":20811773,"url":"https://github.com/prestaconcept/capistrano-archive","last_synced_at":"2025-05-07T10:09:43.393Z","repository":{"id":59151828,"uuid":"136492536","full_name":"prestaconcept/capistrano-archive","owner":"prestaconcept","description":"Archive scm plugin for Capistrano","archived":false,"fork":false,"pushed_at":"2018-06-22T07:53:10.000Z","size":11,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T10:09:22.353Z","etag":null,"topics":["capistrano","capistrano-plugin"],"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/prestaconcept.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-06-07T14:54:53.000Z","updated_at":"2022-04-07T14:08:34.000Z","dependencies_parsed_at":"2022-09-13T11:00:46.269Z","dependency_job_id":null,"html_url":"https://github.com/prestaconcept/capistrano-archive","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prestaconcept%2Fcapistrano-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prestaconcept%2Fcapistrano-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prestaconcept%2Fcapistrano-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prestaconcept%2Fcapistrano-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prestaconcept","download_url":"https://codeload.github.com/prestaconcept/capistrano-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856555,"owners_count":21814858,"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":["capistrano","capistrano-plugin"],"created_at":"2024-11-17T20:47:09.284Z","updated_at":"2025-05-07T10:09:43.331Z","avatar_url":"https://github.com/prestaconcept.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# capistrano-archive\n\n[![Gem Version](https://badge.fury.io/rb/capistrano-archive.svg)](https://badge.fury.io/rb/capistrano-archive)\n\nThis plugin adds a new scm to Capistrano 3 allowing deployment from an archive stored on the target server (s).\n\n## Features\n\n * Upload an archive (tar.bz2 as default) to target\n * Create release from the archive\n * Can use a file from the archive to know the deployed revision (./REVISION as default) \n * Workflow between deploy stages copying the local archive on stage directory \n\n## Installation\n\nPut this in the Gemfile\n```\n    gem 'capistrano-archive'\n```\n\nThen run \n```    \n    bundle install\n```\n\nAdd theses lines to your Capfile\n\n```ruby\n# Include and use capistrano archive \nrequire \"capistrano/archive\"\ninstall_plugin Capistrano::Archive::SCM\n```\n\n## Usage\n\nFirst, you need to have a build system storing artefact release on the server used to deploy.\n\n### Archive location and name\n\nTo specify the archive location, you can set the `:archive_release_path` variable. As default, the archive is supposed to be stored in the current directory.\n\nThe archive name is built as `:application_:branch` but you can change that with the `:archive_name` variable.  \n\n### Compression\n\nThe tar is compressed with bzip as default but you can change that with `:archive_extension` and `:archive_tar_options` variables.\n\n### Upload\n\nAs default the archive is sent in the `:tmp_dir` but you can change the destination using the `:archive_remote_path` variable.\n\nIf you have multiple servers in same stage, you can upload the archive on some servers only using the `:archive_roles` variable.\n\nUsing a shared storage for theses servers, you can upload the archive one time only in a shared location and use it on each server. For example like that :\n\n```\n  set :archive_roles, :upload\n  set :archive_remote_path, \"/nas/...\"\n```\n\n### Workflow\n\nIf you want have workflow between stage, like force deploy on staging before production, you can set the  `:archive_workflow_previous` variable in your stages config file.\n\nFor example, in a *staging.rb* file, set the variable like that\n\n```ruby \n  set :archive_workflow_previous, \"build\"  \n```\n\nAnd the archive location will be `:archive_releases_path`/build when you deploy the staging stage.\nAfter the deploy, the archive file will be copied in the `:archive_workflow_next`, as default the current stage.\n\nDo the same in a *production.rb* file\n\n```ruby \n  set :archive_workflow_previous, \"staging\"\n```\n\nAnd the archive location will be `:archive_releases_path`/staging when you deploy the production stage. \nSo you'll have to deploy on staging before production. \n\nIf you want turn off the workflow process, set the variable `:archive_workflow` to false.\n\n### Revision\n\nCapistrano log the revision info, the sha1 commit, in the revisions log file and in the file REVISION.\nSince we are deploying from an archive, if we want to have the same info, it must already be present in the archive.\nThe most easy is to store the commit when build the archive in the REVISION file.\n\nAs default, the plugin can read the REVISION file from the archive.\n\nIf you want to store the info in another file, you can set the file with the `:archive_revision_file` variable.\nIf you have to manipulate the output (grep, awk, etc) you can change the `:archive_revision_command`\n\nIf you want turn off the revision process, set the variable `:archive_revision` to false. \n\n### Variables available\n\nIf you need to change default values, you can set the following configuration variables in `config/deploy.rb` or wherever relevant:\n\n```ruby\n  set :archive_releases_path, \"./\"\n  set :archive_name, \"#{fetch(:application)}_#{fetch(:branch)}\"\n  set :archive_extension, 'tar.bz2'\n  set :archive_tar_options, 'xjf'\n  set :archive_workflow, true\n  set :archive_workflow_previous, \"\"\n  set :archive_workflow_next,\"#{fetch(:stage)}\"\n  set :archive_remote_path, \"#{fetch(:tmp_dir)}\"\n  set :archive_revision, true\n  set :archive_revision_file, './REVISION'\n  set :archive_revision_command, 'cat'\n```\n\n## Contributing\n\nPlease feel free to open an [issue](https://github.com/prestaconcept/capistrano-archive/issues) \nor a [pull request](https://github.com/prestaconcept/capistrano-archive), \nif you want to help.\n\nThanks to\n[everyone who has contributed](https://github.com/prestaconcept/capistrano-archive/graphs/contributors) already.\n\n---\n\n*This project is supported by [PrestaConcept](http://www.prestaconcept.net)*\n\nReleased under the [MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestaconcept%2Fcapistrano-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprestaconcept%2Fcapistrano-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestaconcept%2Fcapistrano-archive/lists"}