Skip to content

Commit ba08385

Browse files
committed
chore: remove code duplication about smash and pg-boss-worker
1 parent 11eb725 commit ba08385

File tree

12 files changed

+7
-28
lines changed

12 files changed

+7
-28
lines changed

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ WORKDIR /app/packages/cardano-services
114114
CMD ["node", "dist/cjs/cli.js", "start-blockfrost-worker"]
115115

116116
FROM cardano-services as pg-boss-worker
117+
WORKDIR /config
118+
COPY compose/schedules.json .
119+
ENV SCHEDULES=/config/schedules.json
117120
WORKDIR /app/packages/cardano-services
118121
CMD ["node", "dist/cjs/cli.js", "start-pg-boss-worker"]
119122

File renamed without changes.

packages/cardano-services/config/network/preprod/schedule.json

Whitespace-only changes.

packages/cardano-services/config/network/preprod/schedules.json

Whitespace-only changes.

packages/cardano-services/docker-compose.yml

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ services:
2525
volumes:
2626
- ./config/network/${NETWORK:-mainnet}:/config
2727

28-
pg-boss-worker:
29-
volumes:
30-
- ./environments/.schedules.json:/config/schedules.json
31-
3228
cardano-submit-api:
3329
volumes:
3430
- ./config/network/${NETWORK:-mainnet}:/config
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
METADATA_FETCH_MODE="smash"
21
SMASH_URL="http://cardano-smash:3100/api/v1"
3-
SCHEDULES="/config/schedules.json"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
2-
METADATA_FETCH_MODE="smash"
32
SMASH_URL="https://smash.cardano-mainnet.iohk.io/api/v1"
4-
SCHEDULES="/config/schedules.json"
53
TOKEN_METADATA_SERVER_URL="https://tokens.cardano.org"
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
22
OGMIOS_PORT=${OGMIOS_PORT:-1339}
3-
METADATA_FETCH_MODE="smash"
4-
SCHEDULES="/config/schedules.json"
3+
SMASH_URL="https://preprod-smash.world.dev.cardano.org/api/v1"
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
22
OGMIOS_PORT=${OGMIOS_PORT:-1340}
3-
METADATA_FETCH_MODE="smash"
4-
SCHEDULES="/config/schedules.json"
3+
SMASH_URL="https://preview-smash.world.dev.cardano.org/api/v1"

packages/cardano-services/test/cli.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ describe('CLI', () => {
544544

545545
describe('schedules', () => {
546546
testPgBoss('accepts a valid schedule file', 'pgboss', {
547-
args: ['--schedules', 'environments/schedules.json'],
548-
env: { SCHEDULES: 'environments/schedules.json' },
547+
args: ['--schedules', '../../compose/schedules.json'],
548+
env: { SCHEDULES: '../../compose/schedules.json' },
549549
expectedArgs: {
550550
args: { schedules: [{ cron: '0 * * * *', queue: 'pool-delist-schedule', scheduleOptions: {} }] }
551551
}

packages/e2e/docker-compose.yml

-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ services:
7474
volumes:
7575
- ./local-network/config/network:/config
7676

77-
pg-boss-worker:
78-
volumes:
79-
- ./schedules.json:/config/schedules.json
80-
8177
cardano-submit-api:
8278
depends_on:
8379
local-testnet:

packages/e2e/schedules.json

-10
This file was deleted.

0 commit comments

Comments
 (0)