Skip to content

API for Lando (An automatic code lander for Mozilla)

License

Notifications You must be signed in to change notification settings

purelogiq/lando-api

 
 

Repository files navigation

Lando API

new phacility clobber more clobber An [clobber test] microservice that turns Phabricator revisions into Mercurial commits. gogogog Part of Mozilla Conduit, our code management microservice ecosystem.

Building the service

Prerequisites
  • docker (on OS X you will want docker-machine, too)
  • docker-compose
  • pyinvoke (v0.13+, can be installed on OS X with a Homebrew formula)
Running the development server

To create a database:

$ invoke upgrade

To build and start the development services' containers:

$ docker-compose up 
Accessing the development server

You need to tell docker-compose to map the webservice's exposed port to a port on your docker host system. Create a file named docker-compose.override.yml in the project root with these contents:

version: '2'
services:
  lando-api:
    ports:
      - 8000:80

Now run docker-compose up in the project root.

You can use a tool like httpie to test the service.

$ http localhost:8000
HTTP/1.0 302 FOUND
Content-Length: 0
Content-Type: application/json
Date: Fri, 28 Apr 2017 00:03:10 GMT
Location: http://localhost:8000/ui/
Server: Werkzeug/0.12.1 Python/3.5.3 

Browsing the API documentation

Start a development server and expose its ports as documented above, and visit http://localhost:8000/ui/ in your browser to view the API documentation.

Testing

We're using pytest with pytest-flask. All tests are placed in ./tests/ To run the tests please call

$ invoke test

test test test clobber it clobber more Clobber

About

API for Lando (An automatic code lander for Mozilla)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Mako 0.5%