{"id":18936871,"url":"https://github.com/moustacheful/heroku-mitosis","last_synced_at":"2025-07-06T23:01:53.110Z","repository":{"id":57262946,"uuid":"127570657","full_name":"moustacheful/heroku-mitosis","owner":"moustacheful","description":"A package to make copies of heroku apps for reviewing purposes","archived":false,"fork":false,"pushed_at":"2019-03-13T19:50:15.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T15:42:10.869Z","etag":null,"topics":["heroku","json","node","review-app"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moustacheful.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"2018-03-31T20:56:47.000Z","updated_at":"2019-10-02T18:00:39.000Z","dependencies_parsed_at":"2022-09-01T04:31:57.589Z","dependency_job_id":null,"html_url":"https://github.com/moustacheful/heroku-mitosis","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moustacheful%2Fheroku-mitosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moustacheful%2Fheroku-mitosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moustacheful%2Fheroku-mitosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moustacheful%2Fheroku-mitosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moustacheful","download_url":"https://codeload.github.com/moustacheful/heroku-mitosis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129146,"owners_count":21217293,"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":["heroku","json","node","review-app"],"created_at":"2024-11-08T12:09:07.020Z","updated_at":"2025-04-15T18:31:37.250Z","avatar_url":"https://github.com/moustacheful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heroku Mitosis\n\nA package for creating copies of heroku applications through the CLI, using [Heroku's app schema](https://devcenter.heroku.com/articles/app-json-schema) as a base.\n\nDesigned to be used mainly as a part of your CI pipeline to create review apps.\n\n## Tasks\n\n### `setup` task\n\nSets up or updates an application\n\n#### Arguments\n\n| Name        | Description                                                       |\n| ----------- | ----------------------------------------------------------------- |\n| `--tarball` | The public tarball url that contains the application source code. |\n| `--name`    | The application name.                                             |\n| `--apiKey`  | Heroku API key                                                    |\n\n#### Description\n\n##### If the application exists\n\n1. Updates the application using the tarball, outputting the deployment logs.\n\n##### If the application does not exist\n\n1. Creates an application based on the `app.json` on the root of the application.\n2. Waits for the app to be fully provisioned, outputting the deployment logs.\n3. Adds collaborators, if any. (see: [Custom app.json properties](#custom-appjson-properties))\n4. Adds the application to a particular pipeline stage. (see: [Custom app.json properties](#custom-appjson-properties))\n\n---\n\n### `destroy` task\n\nDestroys an application by its name\n\n#### Arguments\n\n| Name       | Description           |\n| ---------- | --------------------- |\n| `--name`   | The application name. |\n| `--apiKey` | Heroku API key        |\n\n## Example - GitLab CI\n\nIn here we use some of the readily available CI variables: `CI_BUILD_REF_SLUG`, `CI_BUILD_REF_NAME`, plus some user defined\nvariables: `GITLAB_TOKEN` and `HEROKU_API_KEY`. More [here](https://docs.gitlab.com/ee/ci/review_apps/).\n\nThis will create an app with the name of the branch as the application name. Using a prefix would be recommended. Keep in mind Heroku limits the maximum amount of characters on the application name (to 32, apparently), and this is not handled by this package.\n\n```yaml\nreview:\n  stage: review\n  when: manual # or auto\n  script:\n    - npx heroku-mitosis setup --name=$CI_BUILD_REF_SLUG --tarball=https://gitlab.com/namespace/project/repository/$CI_BUILD_REF_SLUG/archive.tar?private_token=$GITLAB_TOKEN --apiKey=$HEROKU_API_KEY\n  environment:\n    name: review/$CI_BUILD_REF_NAME\n    url: https://$CI_BUILD_REF_SLUG.herokuapp.com\n    on_stop: stop_review\n  only:\n    - branches\n  except:\n    - master\n    - development\n\nstop_review:\n  stage: review\n  script:\n    - npx heroku-mitosis destroy --name=$CI_BUILD_REF_SLUG --apiKey=$HEROKU_API_KEY\n  when: manual\n  environment:\n    name: review/$CI_BUILD_REF_NAME\n    action: stop\n```\n\n## Custom app.json properties\n\nThere are a few custom properties that are not part of the app.json schema that are under the `__mitosis` namespace. These add automation of commonly used Heroku features. Currently, these are:\n\n```javascript\n  \"__mitosis\": {\n    \"pipeline\": {\n      // Adds this app to an already existent pipeline named foo. The Heroku account must have access to it.\n      \"name\": \"foo\",\n\n      // The stage coupling in the pipeline this app is added to. With review, it behaves as it would with the github integration. Possible values: :\"test\", \"review\", \"development\", \"staging\", \"production\"\n      \"stage\": \"review\"\n    },\n    \"collaborators\": [\n      // You may add additional users that will have access to this app. The users must already exist in Heroku.\n      \"foo@company.com\",\n      \"bar@company.com\"\n    ],\n    \"features\": [\n      // Additional Heroku features can be enabled here. Possible features should be available here: https://devcenter.heroku.com/categories/labs\n      \"runtime-dyno-metadata\"\n    ]\n  }\n```\n\n##### Notes\n\nRemember to clean up your unused environments, be a good sport and don't abuse heroku's free resources!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoustacheful%2Fheroku-mitosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoustacheful%2Fheroku-mitosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoustacheful%2Fheroku-mitosis/lists"}