Skip to content

Commit e929106

Browse files
Update taskfile and README
1 parent 96c82d3 commit e929106

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
This project uses [Taskfile](https://taskfile.dev/) for running tasks. The following tasks are available
1212

13-
- `task build` - creates the executable storing it in `out/bin` directory along with the config file
14-
- `task clean` - cleans various build artifacts
15-
- `task d.build` - builds the docker container
16-
- `task d.down` - shuts down the docker containers
17-
- `task d.up` - starts up the docker containers (postgres + gomin api)
18-
- `task db.migrate` - useful when changing the `database/schema.hcl` file, applies changes to the local database
19-
- `task db.up` - useful for ONLY starting the database (not the api)
20-
- `task server.run` - runs the code locally (not using docker)
21-
- `task test` - runs tests including coverage
13+
* build: Builds a local executable, outputs to out/bin/gomin
14+
* clean: Cleans up build artifacts, including out, bin, and test reports
15+
* d.build: Builds the docker iamge, marks it as latest
16+
* d.down: Shuts down all docker containers in the docker compose file
17+
* d.up: Starts up all docker containers, builds and runs the API as well
18+
* db.migrate: Runs the database migration, ensures that the local postgres database is running
19+
* db.up: Starts the database WITHOUT migrations
20+
* server.run: Starts the database, runs migrations, builds the server, and starts the server
21+
* test: Runs all of the tests in all of the go source directories
2222

2323
## Roadmap
2424

@@ -27,9 +27,9 @@ This project uses [Taskfile](https://taskfile.dev/) for running tasks. The foll
2727
3. [x] - Add pre-commit
2828
4. [x] - Initial database setup
2929
5. [x] - Incorpoate database into REST API
30-
6. [ ] - Integration tests for database
31-
7. [ ] - E2E tests for REST API
32-
8. [ ] - Add github build for golang
30+
6. [x] - Integration tests for database
31+
7. [x] - E2E tests for REST API
32+
8. [x] - Add github build for golang
3333
9. [x] - Add docker packaging
3434
10. [ ] - Add docker image build in Github Actions on Tag
3535
11. [ ] - Terraform plan for RDS

Taskfile.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,36 @@ env:
55

66
tasks:
77
build:
8+
desc: Builds a local executable, outputs to out/bin/gomin
89
cmds:
910
- mkdir -p out/bin
1011
- cp cmd/config.yaml out/bin
1112
- go build -mod vendor -o out/bin/gomin cmd/main.go
1213

1314
clean:
15+
desc: Cleans up build artifacts, including out, bin, and test reports
1416
cmds:
1517
- rm -fr ./bin
1618
- rm -fr ./out
1719
- rm -f ./junit-report.xml checkstyle-report.xml ./coverage.xml ./profile.cov yamllint-checkstyle.xml
1820

1921
d.build:
22+
desc: Builds the docker iamge, marks it as latest
2023
cmds:
2124
- docker build -t ghcr.io/pauljamescleary/gomin:latest .
2225

2326
d.down:
27+
desc: Shuts down all docker containers in the docker compose file
2428
cmds:
2529
- docker-compose down
2630

2731
d.up:
32+
desc: Starts up all docker containers, builds and runs the API as well
2833
cmds:
2934
- docker-compose up -d --build
3035

3136
db.migrate:
37+
desc: Runs the database migration, ensures that the local postgres database is running
3238
deps: [db.up]
3339
cmds:
3440
- |
@@ -38,20 +44,13 @@ tasks:
3844
--to "file://database/schema.hcl" \
3945
--dev-url "docker://postgres/15"
4046
41-
db.update:
42-
cmds:
43-
- |
44-
atlas schema apply \
45-
--auto-approve \
46-
--url "$DATABASE_URL" \
47-
--to "file://database/schema.hcl" \
48-
--dev-url "docker://postgres/15"
49-
5047
db.up:
48+
desc: Starts the database WITHOUT migrations
5149
cmds:
5250
- docker-compose up -d db
5351

5452
server.run:
53+
desc: Starts the database, runs migrations, builds the server, and starts the server
5554
deps: [db.migrate,build]
5655
cmds:
5756
- ./out/bin/gomin -configpath "{{ .TASKFILE_DIR }}/out/bin/config.yaml"
@@ -60,6 +59,7 @@ tasks:
6059
APP_PORT: 1323
6160

6261
test:
62+
desc: Runs all of the tests in all of the go source directories
6363
cmds:
6464
- (rm /tmp/unit_coverage.out || echo "Deleted Old files")
6565
- go mod vendor

0 commit comments

Comments
 (0)