-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nick/neos 313 add mockery to devcontainer features (#624)
- Loading branch information
Showing
4 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,46 @@ | ||
update_frontend_client() { | ||
rm -rf ../frontend/neosync-api-client | ||
mkdir -p ../frontend/neosync-api-client | ||
mv gen/es/protos/** ../frontend/neosync-api-client | ||
rm -rf gen/es | ||
} | ||
|
||
# `buf format -w` writes to each file, so causes tilt to loop. instead we instruct buf | ||
# to just output the changes in diff format and apply those. | ||
BUF_VERSION=$(cat BUF_VERSION) | ||
SQLC_VERSION=$(cat SQLC_VERSION) | ||
docker run --rm -i --volume "./:/workspace" --workdir "/workspace" "bufbuild/buf:${BUF_VERSION}" format -d | patch --quiet | ||
docker run --rm -i --volume "./:/workspace" --workdir "/workspace" "bufbuild/buf:${BUF_VERSION}" generate & | ||
docker run --rm -i --volume "./:/workspace" --workdir "/workspace" "bufbuild/buf:${BUF_VERSION}" generate --template ./buf-es.gen.yaml & | ||
docker run --rm -i --volume "./:/src" --workdir "/src" "sqlc/sqlc:${SQLC_VERSION}" generate & | ||
|
||
# buf fmt | ||
docker run --rm -i \ | ||
--volume "./protos:/workspace" \ | ||
--workdir "/workspace" \ | ||
"bufbuild/buf:${BUF_VERSION}" format -d | patch --quiet | ||
|
||
# buf generate | ||
docker run --rm -i \ | ||
--volume "./gen:/workspace/gen" \ | ||
--volume "./buf.work.yaml:/workspace/buf.work.yaml" \ | ||
--volume "./buf.gen.yaml:/workspace/buf.gen.yaml" \ | ||
--volume "./protos:/workspace/protos" \ | ||
--workdir "/workspace" \ | ||
"bufbuild/buf:${BUF_VERSION}" generate & | ||
docker run --rm -i \ | ||
--volume "./gen:/workspace/gen" \ | ||
--volume "./buf.work.yaml:/workspace/buf.work.yaml" \ | ||
--volume "./buf-es.gen.yaml:/workspace/buf.gen.yaml" \ | ||
--volume "./protos:/workspace/protos" \ | ||
--workdir "/workspace" \ | ||
"bufbuild/buf:${BUF_VERSION}" generate & | ||
|
||
# sqlc | ||
docker run --rm -i \ | ||
--volume "./gen:/workspace/gen" \ | ||
--volume "./sql:/workspace/sql" \ | ||
--volume "./sqlc.yaml:/workspace/sqlc.yaml" \ | ||
--workdir "/workspace" \ | ||
"sqlc/sqlc:${SQLC_VERSION}" generate & | ||
wait | ||
|
||
rm -rf ../frontend/neosync-api-client | ||
mkdir -p ../frontend/neosync-api-client | ||
mv gen/es/protos/** ../frontend/neosync-api-client | ||
rm -rf gen/es | ||
update_frontend_client & | ||
|
||
wait |