Build a map of all the United States national parks using Habitat! Build, deploy, and manage the application to any cloud, virtual machine, or container.
With this demo, you'll discover the magical space-cats living inside of Habitat, and learn the power of packaging, shipping, and updating applications in one atomic format.
You can build the application by simply installing Habitat on your workstation and using the Habitat Studio.
- Clone the repo.
cd national-parks
hab studio enter
build
Watch as the application builds! It should take a few minutes.
If you're showing this as a demo to others, this is a good time to talk about the plan.sh and show how it relates to the build process.
Ready to see what the app looks like on your local workstation with Docker?
Inside the Studio, run:
- hab pkg export docker path/to/build.hart
Now you'll have a Docker container on your local workstation.
- Modify national-parks/docker-compose.yml to match your origin.
national-parks:
image: myorigin/national-parks
-
docker-compose up
-
Browse to http://localhost:8081/national-parks to see the app.
Let's show the app in AWS using Terraform!
-
Create a
terraform.tfvars
in thenational-parks/terraform/aws
directory. An example is provided for you atnational-parks/terraform/aws/example.tfvars
-
cd national-parks/terraform/aws
-
terraform init
-
terraform plan
-
terraform apply -auto-approve
-
Browse to the URL output by Terraform for you.
Let's update the appliation with some brand new colors to make a new version.
-
Modify
src/main/webapp/index.html
by replacing it with the contents ofindex.html.new
. You can revert and show a rollback too, by usingindex.html.old
. -
Rebuild the app in the Habitat Studio.
-
Re-export the container, or upload the new package to builder.