Skip to content

Vagrantfile for Kong development environment

Notifications You must be signed in to change notification settings

tyiss/kong-vagrant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Website Documentation Mailing List Gitter Badge

Vagrant is used to create an isolated development environment for Kong including Cassandra.

Starting the environment

Once you have Vagrant installed, follow those steps:

# clone the Kong repo
$ git clone https://github.com/Mashape/kong

# clone this repository
$ git clone https://github.com/Mashape/kong-vagrant
$ cd kong-vagrant/

# start a box with a folder synced to your local Kong clone
$ KONG_PATH=/path/to/kong/clone/ vagrant up

This will tell Vagrant to mount your local Kong repository under the guest's /kong folder.

The startup process will install all the dependencies necessary for developing (including Cassandra). The Kong source code is mounted at /kong. The host ports 8000 and 8001 will be forwarded to the Vagrant box.

Environment Variables

You can alter the behavior of the provision step by setting the following environment variables:

name description default
KONG_PATH the path to mount your local Kong source under the guest's /kong folder ../kong
KONG_VERSION the Kong version number to download and install at the provision step latest
KONG_VB_MEM virtual machine memory (RAM) size (in MB) 2048

Building and running Kong

To build Kong execute the following commands:

# SSH into the vagrant box
$ vagrant ssh

# switch to the mounted Kong repo
$ cd /kong

# install Kong
$ sudo make dev

# start Kong
$ kong start -c kong_DEVELOPMENT.yml

Testing Kong

To verify Kong is running successfully, execute the following command from the host machine:

$ curl http://localhost:8001

You should receive a JSON response:

{
  "tagline": "Welcome to Kong",
  "version": "0.4.1",
  "hostname": "precise64",
  "lua_version": "LuaJIT 2.1.0-alpha",
  "plugins": {
    "enabled_in_cluster": {},
    "available_on_server": [
      ...
    ]
  }
}

Coding

The lua_package_path directive in the configuration specifies that the Lua code in your local folder will be used in favor of the system installation. The lua_code_cache directive being turned off, you can start Kong, edit your local files (on your host machine), and test your code without restarting Kong.

Eventually, familiarize yourself with the Makefile Operations.

Enterprise Support

Support, Demo, Training, API Certifications and Consulting available at http://getkong.org/enterprise.

About

Vagrantfile for Kong development environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%