Getting Started
Last updated
Last updated
Great example of how to frame:
This guide shows you the minimal steps required run an emergence project locally, make changes to it, and see the result.
Before you begin, you'll need Docker and Habitat set up on your workstation:
Install Docker
On Mac and Windows workstations, Docker must be installed to use habitat. On Linux, Docker is optional.
Install Chef Habitat on your system
Chef Habitat is a tool for automating all the build and runtime workflows for applications, in a way that behaves consistently across time and environments. An application automated with Habitat can be run on any operating system, connected to other applications running locally or remotely, and deployed to either a container, virtual machine, or bare-metal system.
Installing Habitat only adds one binary to your system, hab
, and initializes the /hab
tree.
Configure the hab
client for your user
Setting up Habitat will interactively ask questions to initialize ~/.hab
.
This command must be run once per user that will use hab
:
The --recursive
option is used so that any submodule repositories are also cloned.
Change into project's cloned directory
Launch Studio
On any system, launch a studio with:
The HAB_DOCKER_OPTS
environment variable here allows you to use any options supported by docker run
, in this case forwarding ports for the web server and MySQL server from inside the container to your host machine.
Review the notes printed to your terminal at the end of the studio startup process for a list of additional commands provided by your project's .studiorc
Start environment services
Use the studio command start-all
to launch the http server (nginx), the application runtime (php-fpm), and a local mysql server:
Build environment
To build the entire environment and load it, use the studio command update-site
:
Enable user registration form (optional)
If your project has registration disabled by default, you might want to enable it so you can register:
Promote registered user to developer (optional)
After editing code in the working tree, run the studio command update-site
to rebuild and update the environment. A watch-site
command is also available to automatically rebuild and update the environment as changes are made to the working tree.
To get started, from a terminal outside the studio in the root of the repository:
In this example, the project is cloned, but you might use any repository/branch containing an emergence project:
At this point, you should be able to open and see the error message Page not found
.
At this point, should display the current build of the site
After visiting and creating a new user account, you can use the studio command promote-user
to upgrade the user account you just registered to the highest access level:
is used to provide browser-level full-stack testing. The package.json
file at the root of the repository specifies the dependencies for running the test suite and all the configuration/tests for Cypress are container in the cypress/
tree at the root of the repository.