INFRA-2972 | Saurabh | Readme changed

This commit is contained in:
Saurabh Bhagwan Sathe
2024-04-03 16:39:51 +05:30
parent 0fb9ad4263
commit c375c010e8

View File

@@ -1,28 +1,37 @@
# infra-provisioner
This tool provisions infra resources like rds, s3 on demand with details given in `infra_manifest`.
Simply explained, its a thin wrapper over terraform to hide the complexities like hcl, remote backend, targeted resources etc when provisioning resources.
## SonarQube dashboard
## SonarQube dashboard
Take a look at the [sonarqube dashboard](https://sonarqube.cmd.navi-tech.in/dashboard?id=Infra-Provisioner)
## Usage Guide
##### Install
`go get -u -v github.com/navi-infra/infra-provisioner`
`go get -v github.com/navi-infra/infra-provisioner/v2`
##### Check templates generated
`infra-provisioner --manifest sample_infra_manifest.json --template-only database`
##### Run plan for resources
`infra-provisioner --manifest sample_infra_manifest.json --plan database`
##### Provision resource
`infra-provisioner --manifest sample_infra_manifest.json database`
---
## Development Guide
##### Typical workflow
- Add templates to your resource in templates folder
- Make changes to cli to support new resource
- Package templates with `go-bindata -o bindata/bindata.go templates/...`
@@ -30,21 +39,28 @@ Take a look at the [sonarqube dashboard](https://sonarqube.cmd.navi-tech.in/dash
- Dry run with `go run . --manifest sample_infra_manifest.json --template-only resourceName`
##### Package templates
```
go get github.com/shuLhan/go-bindata/cmd/go-bindata
go-bindata -pkg=bindata -o bindata/bindata.go templates/...
```
## Caveats
1. Interrupts, term signals are not handled when code execution moves to bash.
## Before commit
Always run
```shell
go-bindata -o bindata/bindata.go templates/...
go test ./...
```
## After commit
```shell
go-bindata -o bindata/bindata.go templates/...
go test ./...
```
## After commit
Always
- create a tag and push
- run gocd infra agent pipeline
- create a tag and push
- run gocd infra agent pipeline