Skip to content

Commit

Permalink
doc(readme): add config file explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
kperreau committed Apr 17, 2024
1 parent 60f7de0 commit 5c244b7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,43 @@ Follow these steps to install GOAC in your environment. Adjust as necessary for
go install github.com/kperreau/goac
```

## Configuration
Configuring GOAC is straightforward. You need to create a `.goacproject.yaml` file and place it at the root of each project/directory that requires a build.

### File example:
```yaml
# .goacproject.yaml

version: 1.0 # Please do not change this, keep it at 1.0
name: goac # The name of your project/service/application
target: # Currently, GOAC supports two targets: build, build-image
build: # Create the Go binary
exec:
cmd: go # The command to execute for compilation, 'go' in this case
params: # Parameters to add, the path and filename are automatically appended, the final command here will be: go build -ldflags="-s -w" -o . goac
- build
- -ldflags=-s -w
- -o
build-image:
exec:
cmd: docker
params:
- buildx
- build
- --platform=linux/amd64,linux/arm64
- --network
- host
```
### Environnement
You can pass environment variables when executing GOAC, which will naturally be transmitted to the commands.
However, two environment variables are reserved, initialized, and transmitted by GOAC:
```
BUILD_NAME={{project-name}}
PROJECT_PATH={{project-path}}
```
If you run a shell script, you can use these 2 environment variables.

## Usage
GOAC offers commands such as affected and list to manage your monorepo effectively.

Expand Down

0 comments on commit 5c244b7

Please sign in to comment.