# Pipeline Breakdown

Description :  This pipeline is used to Deploy Git-ops lambda for onboarding Resturant via GitOps flow in AWS enviornment (Dev/INT/PROD) 


Steps to use the pipeline :

1) Navigate to Jenkins-> Bred-cloud-gitops-lambda
2) Click on Feature/Main branch 
3) Click on "Build with Parameters"
4) Enter the config file path from bitbucket for specific Enviornment
5) Select Terraform plan from drop and click on build
6) Terraform plan will check for syntatical error , once the buld is successful
7 ) Click on "Build with Parameters" again 
8) Click on Terraform apply to deploy the infrastructure 

URLS :

Jenkins --  https://jenkins.bre.mcd.com/job/BRED%20Projects/job/bred-cloud-gitops-lambda/
Config file path -- https://bitbucket.bre.mcd.com/projects/BRED/repos/bred-cloud-gitops-lambda/browse/terraform

**Terraform Pipeline**

* Uses our `build-tools` container to run the terraform script.
* User selects name of config tfvars file and Terraform action (plan, apply, destroy) before the pipeline is kicked off. 
* Pipeline does a GIT checkout of the Terraform repo.
* Pipeline will run the init.sh script to initialize Terraform.
* Regardless of Terraform action selected, all pipelines will run a `terraform validate` command.
* If user selects a Terraform action of `plan` the pipeline will only run the `terraform plan` command and then exit the pipeline.
* If user selects a Terraform action of `apply` the pipeline will run the `terraform apply` command with an auto approve, and then exit the pipeline.
* If user selects a Terraform action of `destroy` the pipeline will run the `terraform destroy` command with an auto approve, and then exit the pipeline.

# Pipeline Guide

**Confluence**: https://us-confluence.mcd.com/pages/viewpage.action?pageId=140347235

# Development Guidelines

**Confluence**: https://us-confluence.mcd.com/pages/viewpage.action?spaceKey=BREP&title=Development+Guidelines
