Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(filemanager): silence Makefile output and trim lines #187

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/workload/stateless/filemanager/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FILEMANAGER_DATABASE_HOST ?= localhost
FILEMANAGER_DATABASE_PORT ?= 4321
POSTGRES_DATABASE_URL ?= postgresql://filemanager:filemanager@${FILEMANAGER_DATABASE_HOST}:${FILEMANAGER_DATABASE_PORT}/filemanager #pragma: allowlist secret
.EXPORT_ALL_VARIABLES:

export DATABASE_URL=$(POSTGRES_DATABASE_URL)
FILEMANAGER_DATABASE_HOST ?= 0.0.0.0
FILEMANAGER_DATABASE_PORT ?= 4321
DATABASE_URL ?= postgresql://filemanager:filemanager@${FILEMANAGER_DATABASE_HOST}:${FILEMANAGER_DATABASE_PORT}/filemanager #pragma: allowlist secret

## Default target
default: help
Expand All @@ -19,9 +19,11 @@ docker-postgres:
@docker compose up --wait -d postgres
docker-clean:
@docker compose down --volumes
docker-run:
docker-build:
@docker compose build
docker-run: docker-build
@FILEMANAGER_DATABASE_HOST=0.0.0.0 FILEMANAGER_DATABASE_PORT=0 \
docker compose run -d --service-ports postgres | xargs -I {} docker port {} $(FILEMANAGER_DATABASE_PORT)
docker compose run -d --service-ports postgres | xargs -I {} docker port {} 4321

## Build related commands
build: docker-postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ export class Function extends Construct {
// This starts the container running postgres in order to compile queries using sqlx.
// It needs to be executed outside `beforeBundling`, because `beforeBundling` runs inside
// the container context, and docker compose needs to run outside of this context.
const output = exec('make', ['docker-run'], { cwd: manifestPath, shell: true });
const address = output.stdout.toString().trim();
const output = exec('make', ['-s', 'docker-run'], { cwd: manifestPath, shell: true });
// Grab the last line only in case there are other outputs.
const address = output.stdout.toString().trim().match('.*$');

this._function = new RustFunction(this, 'RustFunction', {
manifestPath,
Expand Down
Loading