Skip to content

Commit

Permalink
Fix users db cleanup (skip deploy)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Oct 25, 2023
1 parent 5f8cdcd commit 4d5cf7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 8 additions & 1 deletion scripts/root/dev.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from 'ethers'
import { loadCredentials, getSecret } from '@casimir/aws'
import { ETHEREUM_CONTRACTS, ETHEREUM_NETWORK_NAME, ETHEREUM_RPC_URL } from '@casimir/env'
import { run } from '@casimir/shell'
import { run, runSync } from '@casimir/shell'

/**
* Run an integrated development environment
Expand Down Expand Up @@ -135,4 +135,11 @@ void async function () {
} else {
run(`npm run dev --workspace @casimir/${app}`)
}

if (process.env.MOCK_SERVICES === 'true') {
process.on('SIGINT', () => {
runSync('npm run clean --workspace @casimir/users')
process.exit()
})
}
}()
9 changes: 1 addition & 8 deletions services/users/scripts/db.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
import os from 'os'
import { run, runSync } from '@casimir/shell'
import { run } from '@casimir/shell'
import { getSecret, loadCredentials } from '@casimir/aws'
import { JsonSchema, Schema, accountSchema, nonceSchema, operatorSchema, userSchema, userAccountSchema } from '@casimir/data'

Expand Down Expand Up @@ -65,11 +65,4 @@ void async function () {
}

await run(`atlas schema apply --url "postgres://postgres:password@localhost:5432/users?sslmode=disable" --to "file://${sqlDir}/schema.sql" --dev-url "docker://postgres/15" --auto-approve`)

if (process.env.MOCK_SERVICES === 'true') {
process.on('SIGINT', () => {
runSync('npm run clean --workspace @casimir/users')
process.exit()
})
}
}()

0 comments on commit 4d5cf7c

Please sign in to comment.