Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated tutorial with more Linux caveats and minor formatting fixes #557

Merged
merged 1 commit into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/source/shared/_setup_environment.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ To start building artifacts in Habitat, you first need to clone the Habitat repo

eval "$(docker-machine env default)"

4. From the root of your local repo, run `make shell`. This will build the Docker container that contains a basic development environment for building the Habitat binaries, including the studio environment. During the initial creation process, the Docker container will be built from scratch. This can take several minutes.
If your host machine is running Linux, run `export IN_DOCKER=true`.

> Note: If your host machine is running Linux, run `export IN_DOCKER=true` before calling `make shell`.
4. From the root of your local repo, run `make shell`. This will build the Docker container that contains a basic development environment for building the Habitat binaries, including the studio environment. During the initial creation process, the Docker container will be built from scratch. This can take several minutes.

Once `make shell` completes, you will be at a bash prompt inside the habitat/devshell container. You should see a prompt like the following:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For example, the archive for our Node.js app already has a configuration file ca


2. Open `config/config.json` in your text editor.
3. Copy the contents from the original `config.json` into `config/config.json` as shown below.
3. Copy the contents from the original `config.json` (shown below) into `config/config.json`.

{
"message": "Hello, World!",
Expand Down
4 changes: 2 additions & 2 deletions www/source/tutorials/getting-started-create-plan.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To create a plan, do the following:

[1][default:/src:0]$cd plans

2. Create a new directory and a plan called _mytutorialapp_ by calling the `new-plan` target.
2. Create a new directory and a plan called "mytutorialapp" by calling the `new-plan` target.

[2][default:/src/plans:0]$make new-plan plan=mytutorialapp

Expand Down Expand Up @@ -73,7 +73,7 @@ We now have a skeleton plan, but we need to modify some of its settings before w

pkg_expose=(8080)

You've finished with the basic setup of your plan. It is time to move into defining how our source files from the previous step get installed into the _mytutorialapp_ artifact through callbacks.
You've finished with the basic setup of your plan. It is time to move into defining how our source files from the previous step get installed into the mytutorialapp artifact through callbacks.

## Add in callbacks

Expand Down
9 changes: 6 additions & 3 deletions www/source/tutorials/getting-started-process-build.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Process your build
# Run your service
The Habitat depot can contain multiple versions and releases of a given artifact. When you start a Habitat service, and depending on whether or not you specify a particular version number, Habitat will either pull the latest version, or the latest release for that particular version of the artifact.

A supervisor manages any client app or service process within a Habitat service, so when a Habitat service starts up, the Supervisor executes a command on the client software through a run script that was either generated by Habitat when the artifact was built (through the `pkg_binaries_run` setting), or through a run hook like in the case of the _mytutorialapp_.
A supervisor manages any client app or service process within a Habitat service, so when a Habitat service starts up, the Supervisor executes a command on the client software through a run script that was either generated by Habitat when the artifact was built (through the `pkg_binaries_run` setting), or through a run hook like in the case of mytutorialapp.

Services can currently be run in two different ways: You can either use the supervisor (`hab-sup`) directly, or you can use a Docker container that calls the supervisor. Using the `hab-sup` directly allows you to rapidly install and test your services before uploading any artifacts into a depot; however, using a Docker container does not require you to have the Habitat binaries built and installed on your host machine. Exporting your artifact into a Docker container also allows you to create a portable Habitat service that can be run anywhere Docker containers can run.

Expand All @@ -26,8 +26,9 @@ To show the portability of Habitat, you will export and run a Habitat service fr

[17][default:/src/plans:0]$hab install core/hab-pkg-dockerize

5. Run `hab pkg exec core/hab-pkg-dockerize hab-pkg-dockerize origin/packagename` with the origin and name of your artifact. These values are referenced in the pkg_origin and pkg_name settings of your plan, respectively.
5. Change directory and run `hab pkg exec core/hab-pkg-dockerize hab-pkg-dockerize origin/packagename` with the origin and name of your artifact. These values are referenced in the pkg_origin and pkg_name settings of your plan, respectively.

[18][default:/src/plans:0]$cd /src
[18][default:/src:0]$hab pkg exec core/hab-pkg-dockerize hab-pkg-dockerize myorigin/mytutorialapp

Habitat will proceed to unpack and install all necessary Habitat artifacts, the Habitat command-line interface (CLI) tools and binaries, the mytutorialapp artifact, and all of its dependencies. Then it will create an image using the Docker scratch image as the base image and build up the rest of the image from there.
Expand All @@ -53,10 +54,12 @@ To show the portability of Habitat, you will export and run a Habitat service fr
mytutorialapp(O):
mytutorialapp(O): Running on http://0.0.0.0:8080

4. Because we are running this service in a Docker container, you need the IP address of the VM that is running it to access the message of the day. Type the following command in your terminal window to bring up the site:
4. Because we are running this service in a Docker container, you need the IP address of the VM that is running it to access the message of the day. If your host machine is running Mac OS X, type the following command in your terminal window to bring up the site.

open "http://$(docker-machine ip default):8080/"

If you're running on Linux, you can simply open a browser and go to http://localhost:8080.

Here's an example of what you should see in your browser:

![Screen shot of node.js tutorial output](/images/nodejs-tutorial-output.png)
Expand Down
80 changes: 0 additions & 80 deletions www/source/tutorials/getting-started-run-package.html.md

This file was deleted.