»Initializing and Configuring Waypoint for Your App

Before you can build and deploy your application, you must initialize it with Waypoint.

When you initialize Waypoint for your application, Waypoint first looks to see if there is a Waypoint configuration file (waypoint.hcl) for the app in the directory.

»Waypoint Configuration

The waypoint.hcl configuration file gives Waypoint instructions for how to build, deploy, and release your application.

If Waypoint cannot find the app's configuration file when you run waypoint init, Waypoint will create a starter waypoint.hcl file that you can then customize for your application.

»Examine the Waypoint.hcl File

The remainder of this walkthrough uses the example Ruby application to show how to initialize an app and then build, deploy, and release it with Waypoint.

We will now view the waypoint.hcl file to learn more about the app's configuration.

In the waypoint-examples/ruby/ directory, run the following command:

cat waypoint.hcl

The Terminal will output the contents of the waypoint.hcl file.

project = "example-ruby"

app "example-ruby" {
  build {
    use "pack" {}
  }

  deploy {
    use "docker" {}
  }
}

The build clause defines how Waypoint will build the app. The pack option tells Waypoint to use the most relevant Cloud Native Buildpack to build the application. Since the example app is written in Ruby, Waypoint will use Ruby Cloud Native Buildpacks.

The deploy clause defines how Waypoint will deploy the app. The docker option tells Waypoint to deploy the application to Docker.

»Initialize Waypoint for the Example App

Let us now prepare to build, deploy, and release the application by initializing it with Waypoint.

In the waypoint-examples/ruby directory, run the following command to initialize the application:

$ waypoint init

Waypoint will now initialize the application and then output a message in the Terminal window, such as the following.

✓ Configuration file appears valid
✓ Local mode initialized successfully
✓ Project "example-ruby" and all apps are registered with the server.
✓ Plugins loaded and configured successfully
✓ Authentication requirements appear satisfied.

Project initialized!
You may now call 'waypoint up' to deploy your project or
commands such as 'waypoint build' to perform steps individually.

We can now move on to building and deploying the application.

»Next Step

Getting Started: Building and Deploying