The purpose of this project is to develop a suppliers system for an eCommerce web site backend as a collection RESTful services for a client by adopting DevOps methodology. The final app is hosted on IBM Cloud with CI Delivery Pipeline.
This build is for Sprint 5, intended for the Wednesday, December 11 2019 due date.
Running on IBM Cloud in Prod: (App Dashboard Here)
https://nyu-suppliers-service-f19.mybluemix.net/
Running on IBM Cloud in Dev: (App Dashboard Here)
https://nyu-suppliers-service-f19-dev.mybluemix.net/
DevOps Pipeline in IBM Cloud:
https://cloud.ibm.com/devops/pipelines/74638c62-616b-4ef0-b8e7-d8db2bf6c0a3?env_id=ibm:yp:us-south
GET /suppliers - Returns a list all of the suppliers
GET /suppliers/string:supplierID - Returns the supplier with a given id number
POST /suppliers - creates a new supplier record in the database
PUT /suppliers/string:supplierID - updates a supplier record in the database
DELETE /suppliers/string:supplierID - deletes a supplier record in the database
QUERY /suppliers/ - query the database by the name of the supplier
ACTION /suppliers/string:productId/recommend - query the database for suppliers that serve a certain product with a average rating of 3 or above
string:supplierID is a string of 24 hexadecimal characters eg: 4f4381f4e779897a2c000009
The recommend: Enter the ID of the product of which you'd like to get remmended suppliers.
To run the TDD tests please run the following commands:
git clone https://github.com/nyu-devops-fall19-suppliers/suppliers
cd suppliers
vagrant up
vagrant ssh
cd /vagrant
nosetests
To run the BDD tests please run the following commands:
git clone https://github.com/nyu-devops-fall19-suppliers/suppliers
cd suppliers
vagrant up
vagrant ssh
cd /vagrant
honcho start &
behave
To run the Flask app to create an interactive version of the API, please follow these steps:
vagrant up
vagrant ssh
cd /vagrant
nosetests
FLASK_APP=service:app flask run -h 0.0.0.0
Then the service will available at: http://127.0.0.1:5000/suppliers
vagrant up
vagrant ssh
cd /vagrant
pylint --rcfile=pylint.conf service/*.py
pylint --rcfile=pylint.conf tests/*.py
- MongoDB - MongoDB is a document database
- MongoEngine - a Python Object-Document Mapper for working with MongoDB.
- Nose - Better python testing