{"id":17796990,"url":"https://github.com/lrascao/rebar3_appup_plugin","last_synced_at":"2025-04-05T12:06:16.319Z","repository":{"id":3947790,"uuid":"51479777","full_name":"lrascao/rebar3_appup_plugin","owner":"lrascao","description":"A rebar3 plugin for frictionless release upgrades","archived":false,"fork":false,"pushed_at":"2024-07-22T13:02:38.000Z","size":1010,"stargazers_count":75,"open_issues_count":14,"forks_count":25,"subscribers_count":12,"default_branch":"develop","last_synced_at":"2025-03-29T11:09:29.739Z","etag":null,"topics":["erlang","rebar3","rebar3-plugin","relup"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lrascao.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-10T23:09:35.000Z","updated_at":"2025-03-10T16:38:20.000Z","dependencies_parsed_at":"2024-10-27T11:55:49.000Z","dependency_job_id":"e4986e8d-f240-4c02-b020-0cc86f5673eb","html_url":"https://github.com/lrascao/rebar3_appup_plugin","commit_stats":{"total_commits":106,"total_committers":11,"mean_commits":9.636363636363637,"dds":"0.16981132075471694","last_synced_commit":"bf5c1ff67cbda5cdf5b5ea127ad36e61e4117d69"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Frebar3_appup_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Frebar3_appup_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Frebar3_appup_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lrascao%2Frebar3_appup_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lrascao","download_url":"https://codeload.github.com/lrascao/rebar3_appup_plugin/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332604,"owners_count":20921853,"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":["erlang","rebar3","rebar3-plugin","relup"],"created_at":"2024-10-27T11:50:28.248Z","updated_at":"2025-04-05T12:06:16.292Z","avatar_url":"https://github.com/lrascao.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"rebar3 appup plugin\n=====\n\n[![Build Status](https://github.com/lrascao/rebar3_appup_plugin/workflows/ci/badge.svg)](https://github.com/lrascao/rebar3_appup_plugin/workflows/ci)\n[![hex.pm version](https://img.shields.io/hexpm/v/rebar3_appup_plugin.svg)](https://hex.pm/packages/rebar3_appup_plugin)\n[![gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rebar3-appup-plugin/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link)\n\nA rebar3 plugin for handling release upgrades. Supports the following features:\n   * Automatic generation of the `.appup` file containing instructions necessary to upgrade and downgrade from one release to the other. [More info](doc/UPGRADE_DOWNGRADE.md)\n   * Validation of any `.appup.src` files that might be present, these are scripts that can contain Erlang code. They are templated, evaluated and their results and written to an `.appup` file that is then moved to the target dir. [More info](doc/APPUP_SRC.md)\n   * Handles any dependency `.appup.src` files maintained by your application. [More info](doc/CUSTOM_APPUP.md)\n   * Automatic code injection for `gen_server` state record conversion between versions. [More info](doc/STATE_RECORD_CONVERSION.md)\n   * Automatically generated module dependencies. [More info](doc/MODULE_DEPENDENCIES.md)\n\nDemo\n-----\n### Generating a release upgrade\n\n![gif](http://i.imgur.com/zdfAg6o.gif)\n\n### Upgrading a release\n\n![gif](http://i.imgur.com/khWaee2.gif)\n\nBuild\n-----\n\n    $ rebar3 compile\n\nConfigure\n---\n\nAdd the plugin to your project's rebar.config:\n\n    {plugins, [rebar3_appup_plugin]}.\n\nand the provider hooks:\n\n```\n  {provider_hooks, [\n      {pre, [{tar, {appup, tar}}]},\n      {post, [{compile, {appup, compile}},\n              {clean, {appup, clean}}]}\n  ]}.\n```\n\nApplication upgrade generation\n---\n\nBy generating two releases, the one that is live right now and the one that we want to end up in. We can invoke the plugin and have it generate a special `.appup` file that OTP knows how to process in order to generate a release upgrade file (`relup`). This file contains low level Erlang VM instructions that will transition the Erlang application from one version to another without any downtime. [More info](doc/UPGRADE_DOWNGRADE.md).\n\nUsing an .appup.src file\n---\n\nYou can generate the `.appup` file every time you pack a release with the `rebar3 appup generate` call. However when there is the need to add custom data or instructions to the `.appup` it's useful to have it in source control alongside your `.app.src` file. The `.appup.src` file can contain Erlang code and it's result should be a [valid appup Erlang term](http://erlang.org/doc/man/appup.html). The plugin will look for any files ending in `.appup.src`, perform template variables substitution, evaluate them and have their results written to an `.appup` file that will then be used to generate the relup. [More info](doc/APPUP_SRC.md).\n\nCode Injection\n---\n\nWhen doing relups an issue that comes up often is the problem of ugprading the state record of your `gen_server` code. Most likely you have made some change that needs a new record structure alongside the code that handles it. OTP offers you the `gen_server:code_change/3` call that enables state migration, this implies however that the new code must somehow know about the old record structure to migrate from. The plugin will automatically, by specifying a `-state_record` directive, inject the necessary code into the gen_server's `.beam` file that will take care of the migration. [More info](doc/STATE_RECORD_CONVERSION.md).\n\nAutomatically generated module dependencies\n---\n\nOTP allows the developer to manually specify the dependencies for each module in the `.appup` file, that is, which modules should be loaded before that one. The plugin takes care of this for you, by using `xref` it discovers which modules are being used and adds them to the relevant `.appup` entries. [More info](doc/MODULE_DEPENDENCIES.md).\n\nCommand line options\n---\n\n```\n    Appup generator\n    Usage: rebar3 appup generate\n\n      -p, --previous    location of the previous release\n      -c, --current     location of the current release\n      -t, --target_dir  target dir in which to generate the .appups to\n      -t, --target_dir  target dir in which to generate the .appups to\n      -g, --purge       per module purge instructions, format is\n                          [default | Module]=Purge | PrePurge/PostPurge\n                        where Purge, PrePurge, PostPurge is either soft or brutal. Module is the name of a module in the .appup file, default is a reserved name to apply purge options\n                        to unspecified modules.\n```\n\n    rebar3 appup generate [--previous /path/to/previous/release] \n    [--previous_version version] [--current /path/to/current/release] \n    [--target_dir /path/to/target/dir] [--purge ]\n\n  * previous and current options should be full path names to the release (ie. the folder that contains lib/, releases/)\n  * current is optional and defaults to _build/`\u003cprofile\u003e`/rel\n  * target_dir is optional and defaults to `_build/`\u003cprofile\u003e`/rel/`\u003capp\u003e`/lib/`\u003capp\u003e`/ebin`\n\nCompile\n---\n\n    rebar3 appup compile\n\nClean\n---\n\n    rebar3 appup clean\n\n## Copyright and License\n\nCopyright (c) 2016 Luis Rascão\n\n**rebar3_appup_plugin** source code is licensed under [Apache 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrascao%2Frebar3_appup_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flrascao%2Frebar3_appup_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flrascao%2Frebar3_appup_plugin/lists"}