From bf2984369d30ee9b1b18974b85d8edb9ae373834 Mon Sep 17 00:00:00 2001 From: Chap Ambrose Date: Tue, 23 Jul 2024 08:34:14 -0500 Subject: [PATCH] cleanup heroku.md Signed-off-by: Chap Ambrose --- docs/deployment/heroku.md | 42 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/docs/deployment/heroku.md b/docs/deployment/heroku.md index faf1c2106e..d285e4b397 100644 --- a/docs/deployment/heroku.md +++ b/docs/deployment/heroku.md @@ -7,8 +7,6 @@ description: How to deploy Backstage to Heroku Heroku is a Platform as a Service (PaaS) designed to simplify application deployment. -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/chap/backstage-button) - ## Create App Starting with an existing Backstage app or follow the [getting started guide](https://backstage.io/docs/getting-started/) to create a new one. @@ -17,8 +15,8 @@ Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and create a new Heroku app: ```shell -$ cd your-app/ -$ heroku apps:create +cd your-app/ +heroku apps:create ``` ## Domain @@ -26,7 +24,7 @@ $ heroku apps:create Get Heroku app URL: ```shell -$ heroku domains -a +heroku domains -a .herokuapp.com ``` @@ -59,7 +57,7 @@ Add a build script in `package.json` to compile frontend during deployment: Create a [Procfile](https://devcenter.heroku.com/articles/procfile) in the app's root: ```shell -$ echo "web: yarn workspace backend start --config ../../app-config.yaml --config ../../app-config.production.yaml" > Procfile +echo "web: yarn workspace backend start --config ../../app-config.yaml --config ../../app-config.production.yaml" > Procfile ``` ## Database @@ -67,7 +65,7 @@ $ echo "web: yarn workspace backend start --config ../../app-config.yaml --confi Provision a [Heroku Postgres](https://elements.heroku.com/addons/heroku-postgresql) database: ```shell -$ heroku addons:create heroku-postgresql -a +heroku addons:create heroku-postgresql -a ``` Update `database` in `app-config.production.yaml`: @@ -85,7 +83,7 @@ backend: Allow postgres self-signed certificates: ```shell -$ heroku config:set PGSSLMODE=no-verify -a +heroku config:set PGSSLMODE=no-verify -a ``` ## Deployment @@ -93,20 +91,20 @@ $ heroku config:set PGSSLMODE=no-verify -a Commit changes and push to Heroku to build and deploy: ```shell -$ git add Procfile && git commit -am "configure heroku" -$ git push heroku main +git add Procfile && git commit -am "configure heroku" +git push heroku main ``` View the app in the browser: ```shell -$ heroku open -a +heroku open -a ``` View logs: ```shell -$ heroku heroku -a +heroku heroku -a ``` ## Docker @@ -116,27 +114,27 @@ As an alternative to git deploys, Heroku also [supports container images](https: Login to Heroku's container registry: ```shell -$ heroku container:login +heroku container:login ``` Configure the Heroku app to run a container image: ```shell -$ heroku stack:set container -a +heroku stack:set container -a ``` -Locally run the [host build command](https://backstage.io/docs/deployment/docker/#host-build): +Locally run the [host build commands](https://backstage.io/docs/deployment/docker/#host-build), they must be run whenever you are going to publish a new image: ```shell -$ yarn build:backend --config ../../app-config.yaml --config ../../app-config.production.yaml +yarn install --frozen-lockfile +yarn tsc +yarn build:backend --config ../../app-config.yaml --config ../../app-config.production.yaml ``` -Build, push, and release the container image: +Build, push, and release the container image to the `web` dyno: ```shell -$ docker image build . -f packages/backend/Dockerfile --tag registry.heroku.com//web - -$ docker push registry.heroku.com//web - -$ heroku container:release web -a +docker image build . -f packages/backend/Dockerfile --tag registry.heroku.com//web +docker push registry.heroku.com//web +heroku container:release web -a ```