forked from antonputra/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·22 lines (17 loc) · 857 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -ex
cd terraform
terraform init
terraform apply --auto-approve
# Build app binaries
cd ../go-app
GOOS=linux GOARCH=amd64 go build -o target/rest-server cmd/rest-server/main.go
GOOS=linux GOARCH=amd64 go build -o target/rest-client cmd/rest-client/main.go
GOOS=linux GOARCH=amd64 go build -o target/grpc-server cmd/grpc-server/main.go
# Generate certificates
cd ../demo-certs
cfssl gencert -initca ca-csr.json | cfssljson -bare ca
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=demo api-envoy-antonputra-pvt-csr.json | cfssljson -bare api-envoy-antonputra-pvt
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=demo api-nginx-antonputra-pvt-csr.json | cfssljson -bare api-nginx-antonputra-pvt
cd ../ansible
ansible-playbook -i aws_ec2.yaml --private-key ~/.ssh/devops.pem infra.yaml