Skip to content

Commit

Permalink
Improve envtool (#1598)
Browse files Browse the repository at this point in the history
Closes #1590.
  • Loading branch information
AlekSi authored Nov 30, 2022
1 parent 0cbcd6d commit 373d939
Show file tree
Hide file tree
Showing 9 changed files with 290 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
if: always()
run: |
bin/task fuzz-corpus
go run ./cmd/fuzztool/fuzztool.go corpus seed ../fuzz-corpus
go run ./cmd/fuzztool corpus seed ../fuzz-corpus
working-directory: source

# `secrets` are not supported in `if`, so we have to do this trick with environment variable:
Expand Down
30 changes: 18 additions & 12 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ vars:
FUZZCORPUS: ../fuzz-corpus
RACEFLAG: -race={{and (ne OS "windows") (ne ARCH "arm")}}
BUILDTAGS: ferretdb_tigris
SERVICES: postgres tigris mongodb

tasks:
# invoked when `task` is run without arguments
Expand Down Expand Up @@ -68,34 +69,39 @@ tasks:
- task: env-pull
- task: init

env-setup:
deps: [gen-version]
cmds:
- go run {{.RACEFLAG}} ./cmd/envtool/main.go

env-up-detach:
cmds:
- >
docker-compose up --always-recreate-deps --force-recreate --remove-orphans --renew-anon-volumes --timeout=0 --detach
--build
postgres tigris cockroach mongodb
{{.SERVICES}}
env-up-detach-offline:
cmds:
- >
docker-compose up --always-recreate-deps --force-recreate --remove-orphans --renew-anon-volumes --timeout=0 --detach
postgres tigris mongodb
{{.SERVICES}}
env-setup:
deps: [gen-version]
cmds:
- go run {{.RACEFLAG}} ./cmd/envtool

env-logs:
cmds:
- docker-compose ps --all
- docker-compose logs --follow

env-up:
desc: "Start development environment"
deps: [env-up-detach, env-setup]
cmds:
- docker-compose logs --follow
- task: env-logs

env-up-offline:
deps: [env-up-detach-offline, env-setup]
cmds:
- docker-compose logs --follow
- task: env-logs

env-pull:
desc: "Pull development environment's Docker images"
Expand Down Expand Up @@ -223,9 +229,9 @@ tasks:
fuzz-corpus:
desc: "Sync seed and generated fuzz corpora with FUZZCORPUS"
cmds:
- go run {{.RACEFLAG}} ./cmd/fuzztool/fuzztool.go corpus generated {{.FUZZCORPUS}}
- go run {{.RACEFLAG}} ./cmd/fuzztool/fuzztool.go corpus seed {{.FUZZCORPUS}}
- go run {{.RACEFLAG}} ./cmd/fuzztool/fuzztool.go corpus {{.FUZZCORPUS}} generated
- go run {{.RACEFLAG}} ./cmd/fuzztool corpus generated {{.FUZZCORPUS}}
- go run {{.RACEFLAG}} ./cmd/fuzztool corpus seed {{.FUZZCORPUS}}
- go run {{.RACEFLAG}} ./cmd/fuzztool corpus {{.FUZZCORPUS}} generated

build-testcover:
desc: "Build bin/ferretdb-testcover"
Expand Down
Loading

1 comment on commit 373d939

@vercel
Copy link

@vercel vercel bot commented on 373d939 Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ferret-db – ./

ferret-db.vercel.app
ferret-db-ferretdb.vercel.app
ferret-db-git-main-ferretdb.vercel.app

Please sign in to comment.