Skip to content

Commit

Permalink
build: add galoy-pay to tiltfile
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Nov 30, 2023
1 parent cbf7a71 commit 067109b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/pay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"dev": "next dev -p 3002",
"start": "next start",
"build": "next build",
"lint:fix": "eslint --fix --ext .ts,.tsx .",
Expand Down
37 changes: 37 additions & 0 deletions dev/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ cfg = config.parse()
CORE_TEST_LABEL = "core"
CONSENT_TEST_LABEL = "consent"
DASHBOARD_TEST_LABEL = "dashboard"
PAY_TEST_LABEL = "pay"

TEST_RESOURCES = {
CORE_TEST_LABEL: "api-test",
CONSENT_TEST_LABEL: "consent-test",
DASHBOARD_TEST_LABEL: "dashboard-test",
PAY_TEST_LABEL: "pay-test",
}

is_ci=("ci" in sys.argv) or cfg.get("bats", False)
Expand Down Expand Up @@ -62,6 +64,29 @@ local_resource(
],
)

pay_target = "//apps/pay:dev"
if is_ci:
pay_target = '//apps/pay:pay'
local_resource(
"pay",
labels = ["apps"],
cmd = "buck2 build {}".format(pay_target),
serve_cmd = "buck2 run {}".format(pay_target),
serve_env = {
"NEXTAUTH_URL": "http://localhost:3002",
"NEXTAUTH_SECRET": "secret",
"PORT": "3002",
},
deps = _buck2_dep_inputs(pay_target),
allow_parallel = True,
resource_deps = [
"api",
],
links = [
link("http://localhost:3002", "pay"),
],
)

local_resource(
name='hydra-dashboard',
labels = ['apps'],
Expand Down Expand Up @@ -108,6 +133,18 @@ local_resource(
],
)

pay_test_target = "//apps/pay:test-integration"
local_resource(
"pay-test",
labels = ["test"],
auto_init = is_ci and DASHBOARD_TEST_LABEL in cfg.get("test", []),
cmd = "buck2 test {}".format(pay_test_target),
resource_deps = [
"api",
"pay",
],
)

local_resource(
name='init-test-user',
labels = ['test'],
Expand Down

0 comments on commit 067109b

Please sign in to comment.