-
Notifications
You must be signed in to change notification settings - Fork 33
/
bookstore_cicd.sh
46 lines (45 loc) · 1.59 KB
/
bookstore_cicd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
echo "************** Creating CI/CD pipeline ****************"
curdir=$(pwd)
cd $curdir/infrastructure/cicd/terraform
terraform init -input=false
#terraform plan -input=false
terraform apply -input=false -auto-approve
cicd_resource_api_repository_url=$(terraform output -raw cicd_resource_api_repository_url)
cicd_inventory_api_repository_url=$(terraform output -raw cicd_inventory_api_repository_url)
cicd_renting_api_repository_url=$(terraform output -raw cicd_renting_api_repository_url)
cicd_clients_api_repository_url=$(terraform output -raw cicd_clients_api_repository_url)
cicd_front_end_repository_url=$(terraform output -raw cicd_front_end_repository_url)
echo "************** Step- 5 - Pushing code into Code Commits ****************"
cd $curdir/resource-api
git init
git remote add origin $cicd_resource_api_repository_url
git add .
git commit -m "resource api"
git push -u origin master
cd $curdir/inventory-api
git init
git remote add origin $cicd_inventory_api_repository_url
git add .
git commit -m "Inventory api"
git push -u origin master
cd $curdir/renting-api
git init
git remote add origin $cicd_renting_api_repository_url
git add .
git commit -m "renting api"
git push -u origin master
cd $curdir/clients-api
git init
git remote add origin $cicd_clients_api_repository_url
git add .
git commit -m "clients api"
git push -u origin master
cd $curdir/front-end
git init
git remote add origin $cicd_front_end_repository_url
git add .
git commit -m "Front End"
git push -u origin master
echo "Codes have been pushed successfully."
echo "Starting Bookstore Application deployment completed successfully."