Migrating Your Workspace To Your Own GitHub Organization with Heroku

Introduction

Knapsack customers are welcome to maintain their workspace on the provided private GitHub repo within Knapsack's GitHub organization, along with the Heroku pipeline.

However, Enterprise customers have the option of migrating their workspace to their own GitHub Organization and connecting the same (or their own) Heroku pipeline.

To kick off the process, please contact your Knapsack representative, or email help@knapsack.cloud.

Once Knapsack's Customer Success team contacts you, work with them to complete the process outlined below

Prerequisites

  1. Important: Before beginning the migration process, please install the Knapsack GitHub App. (You must have the proper GitHub Organization permissions to perform this action.)
  2. To complete the Heroku configuration you will need to install the Heroku CLI (and authenticate after creating an account).

Follow the 8 steps below to complete the process.

  1. Send an email with your migration request to help@knapsack.cloud 
    • Include your GitHub organization so we can initiate the transfer.
    • NOTE: Sending this email will help us track your request within our support system.
  2. Knapsack will kick off the migration process 
    • You or an organization admin will need to accept the transfer (an email will be generated).
  3. When the migration is complete update your knapsack.config.js and all package.json files (root and within the 'packages' directory) 
    • knapsack.config.js will require an update to repoOwner to your organization
    • package.json files will need to update the organization name as well as validating all other fields, such as the repository field.
    • Commit the changes and push back up to the main branch
    • Keep an eye on the "Actions" tab for a successful build (which will result in a new release and version bump for all npm packages)
  4. After verifying everything is building/releasing as it should —> Head over to Heroku to setup deployments
  5. Configure Heroku with assistance from a Knapsack Solutions Engineer OR by doing the following:
    1. Create a new pipeline pointing at your newly migrated workspace
    2. Enable review apps (we recommend destroying stale review apps after 2 days)
    3. Add a production application
    4. Use the Heroku CLI —> set your application from the above step to a container (heroku stack:set container --app your-app-name-here)
    5. In the "Deploy" section of your app, Enable Automatic Deployments.
  6. Test Heroku! 
    • In the "Deploy" section of your app, at the very bottom, click the "Deploy Branch" button
  7. When Heroku has completed the build 
    • Click the "Open App" button in the top right to view your new deployment!
  8. Copy the base URL of your application by right clicking on the "Open App" button and clicking "Copy Link Address"
    • Send this over to us so we can point your workspace at your new application deployment.
    • This will allow you to access your workspace via the usual http://app.knapsack.cloud/site/[YOUR-WORKSPACE]/latest URL

    Wrapping it all up!

    After all of the above steps are completed:

    • Your workspace will build in the cloud every time a merge is made into the main branch of your repo.
    • Since we enabled Review Apps, you'll also get a new deployment for every new PR.
    • If a deployment from a PR ever goes stale — simple push changes up to the PR to build a new one!

    Issues with this guide or completing a step?

    Please let us know or reach out to your Solutions Engineer or email help@knapsack.cloud