Uber app that uses their external API. It is built in Python using flask. The job was to create an working development, testing and production environment and to build a pipeline to move the code through them using jenkins. We started by forking the Uber App from the following repo:
https://github.com/uber/Python-Sample-Application
The Pipeline Solution
- The Chef tool was used to provide the solution.
- Developed a Python and Nginx cookbook to meet application dependencies which was added to the wrapper cookbook and configured application dependencies by calling a requirements.txt file.
- When the user runs
Vagrant up
the application starts running in dev. - Configured Jenkins to run tests and place on the master branch.
- Packer was used to create an Amazon Machine Image (AMI) image and deploy the application on a Cloud Environment.
The above solution completes the whole CI/CD/CD pipeline.
How to install and use
- Clone this repository using git clone
- Go into the named folder
- Run
Vagrant Up
- Go to development.local and you will see the web app.
- Create Nginx cookbook - ✅
- Create Python cookbook - ✅
- Create Cookbook tests that pass - ✅
- Create app project directory - ✅
- Configure the Berks Vendor - ✅
- Add the chef content to the app and arrange the file structure - ✅
- Add the vagrant file and configure it - ✅
- Confirm the environment is fully provisioned for the app to run - ✅
- Run the machine and make sure the Uber app is reachable - ✅
- Create a link between Github & Jenkins - ✅
- Create the first Jenkins job that merges to master - ✅
- Create working unit tests for the merging job - ✅
- Create working integration tests for the merging job - 🔴
- Create a second Jenkins job that makes a AMI (Amazon Machine Image) - ✅
- Confirm AMI has been made on AWS(Amazon Web Services) - ✅
- (Optional Task) Create a AWS instance manually and run the app within the cloud ✅
- (Optional Task) Have Jenkins use the new AMI to make a instance - 🔴
- To begin, clone the GitHub repository HERE
- Navigate into the UberAppProject file and run
berks vendor cookbooks
- Now run
vagrant up
to start the application. - Open your internet browser and type http://development.local
- If successful you will see this page.
If you wish to perform updates on the repository follow the below steps.
- Change to the 'dev' branch using
git checkout dev
- Make the changes
- Then Push to the 'dev' branch using
git push origin dev
- From here the process is automatic, see below for more information.
The UberAppProject has a development pipeline. This is what happens when you make changes and push to the 'dev' branch.
- Push to development branch.
- Jenkins webhook is activated automatically.
- Jenkins then runs the code against the written tests.
- If the code passes then it is automatically merged to master.
- A second Jenkins job is activated on completion of the last.
- Jenkins then interacts with Amazon Web Services and creates a Amazon Machine Image.