Giter Site home page Giter Site logo

habitat-sh / national-parks Goto Github PK

View Code? Open in Web Editor NEW
7.0 15.0 57.0 92 KB

An example of packaging a Tomcat / MongoDB application in Habitat

License: Apache License 2.0

Shell 4.78% Java 24.90% HTML 5.73% HCL 64.59%
habitat tomcat mongodb docker aws terraform azure kubernetes gce cloud-foundry

national-parks's Introduction

National-Parks Habitat Demo

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.

Build

You can build the application by simply installing Habitat on your workstation and using the Habitat Studio.

  1. Clone the repo.
  2. cd national-parks
  3. hab studio enter
  4. 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.

Export to Docker

Ready to see what the app looks like on your local workstation with Docker?

Inside the Studio, run:

  1. hab pkg export docker path/to/build.hart

Now you'll have a Docker container on your local workstation.

  1. Modify national-parks/docker-compose.yml to match your origin.
   national-parks:
    image: myorigin/national-parks
  1. docker-compose up

  2. Browse to http://localhost:8081/national-parks to see the app.

Provision AWS

Let's show the app in AWS using Terraform!

  1. Install Terraform

  2. Create a terraform.tfvars in the national-parks/terraform/aws directory. An example is provided for you at national-parks/terraform/aws/example.tfvars

  3. cd national-parks/terraform/aws

  4. terraform init

  5. terraform plan

  6. terraform apply -auto-approve

  7. Browse to the URL output by Terraform for you.

Update the app

Let's update the appliation with some brand new colors to make a new version.

  1. Modify src/main/webapp/index.html by replacing it with the contents of index.html.new. You can revert and show a rollback too, by using index.html.old.

  2. Rebuild the app in the Habitat Studio.

  3. Re-export the container, or upload the new package to builder.

national-parks's People

Contributors

echohack avatar elliott-davis avatar ericcalabretta avatar jmery avatar smacfarlane avatar smford22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

national-parks's Issues

National Parks map comes up blank in Azure deployments

When spinning up a stack in Azure, the stack completes successfully, but hitting the front end the map is blank rather than having pin drops for each park. You can get around this by sshing to the mongo host and unloading the loading the mongo package again.

Azure RG name conflict

The default Azure RG name is "${var.application}-rg". This is very generic and will produce conflicts (e.g. if tf misbehaves or if multiple users attempt to spin this up at once).

Suggest moving this to `"${var.application}-${var.habitat_origin}-rg" to generate unique RG names on at least a per-user basis.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.