From 9da5a09a08bd80f7d82329e34c3099b77192a168 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 16 Dec 2024 13:42:08 +0100 Subject: [PATCH] Let's start with a generated application instead of quickstarts It's a lot more natural to create a simple application using our tooling rather than doing all sorts of manipulation to extract the code from the quickstarts repo. --- .../main/asciidoc/deploying-to-heroku.adoc | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/src/main/asciidoc/deploying-to-heroku.adoc b/docs/src/main/asciidoc/deploying-to-heroku.adoc index 69cb0d0baf2c5..71e11ead81c63 100644 --- a/docs/src/main/asciidoc/deploying-to-heroku.adoc +++ b/docs/src/main/asciidoc/deploying-to-heroku.adoc @@ -46,16 +46,20 @@ Luckily, there's a dynamic configuration property for it. == Common project setup -This guide will take as input an application developed in the xref:getting-started.adoc[Getting Started guide]. +This guide will take as input a simple application created with the Quarkus tooling: -We need to create a new repository for the application, so follow these steps: +:create-app-artifact-id: getting-started-with-heroku +:create-app-code: +include::{includes}/devtools/create-app.adoc[] -1. Make a clone of the Git repository: `git clone {quickstarts-clone-url}`, -or download an {quickstarts-archive-url}[archive]. -2. Copy the contents of the `quarkus-quickstarts/getting-started` directory to a new directory. -3. Change to the new directory and initialize a new Git repository: `git init -b main`. -4. Add all files to the repository: `git add .`. -5. Commit the files `git commit -a -m 'Initial copy of getting-started'`. +This command will create a new REST application in the `getting-started-with-heroku` directory. + +Let's make this application a Git repository: + +1. Change to the application directory: `cd getting-started-with-heroku`. +2. Initialize a new Git repository: `git init -b main`. +3. Add all files to the repository: `git add .`. +4. Commit the files: `git commit -a -m 'Initial copy of getting-started'`. Heroku can react on changes in your repository, run CI and redeploy your application when your code changes. Therefore, we start with a valid repository already. @@ -165,11 +169,15 @@ First, login to Heroku's container registry: heroku container:login ----- -We need to add an extension to our project to build container images via the Quarkus Maven plugin: +We need to add an extension to our project to add the capability to build container images: + +:add-extension-extensions: container-image-docker +include::{includes}/devtools/extension-add.adoc[] + +Then, let's commit this change: [source,bash] ---- -mvn quarkus:add-extension -Dextensions="container-image-docker" git add pom.xml git commit -am "Add container-image-docker extension." ---- @@ -180,7 +188,7 @@ We get the generated name via `heroku info` and pass it on to the (local) build: [source,bash] ---- APP_NAME=`heroku info | grep "=== .*" |sed "s/=== //"` -mvn clean package\ +./mvnw clean package\ -Dquarkus.container-image.build=true\ -Dquarkus.container-image.group=registry.heroku.com/$APP_NAME\ -Dquarkus.container-image.name=web\ @@ -260,12 +268,12 @@ We opt in to compiling a native image inside a local container, so that we don't [source,bash] ---- APP_NAME=`heroku info | grep "=== .*" |sed "s/=== //"` -mvn clean package\ - -Dquarkus.container-image.build=true\ - -Dquarkus.container-image.group=registry.heroku.com/$APP_NAME\ - -Dquarkus.container-image.name=web\ - -Dquarkus.container-image.tag=latest\ - -Dnative\ +./mvnw clean package \ + -Dquarkus.container-image.build=true \ + -Dquarkus.container-image.group=registry.heroku.com/$APP_NAME \ + -Dquarkus.container-image.name=web \ + -Dquarkus.container-image.tag=latest \ + -Dnative \ -Dquarkus.native.container-build=true ----