Issues with deploy.release_command

I’m running into this too. The release_command runs 2-3 times, exits 0 each time, then the deploy fails.

# fly.toml file generated for ds2-migrate on 2022-05-23T15:07:21-05:00

app = "**********"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []
services = []

[build]
  dockerfile = "../../Dockerfile.migration"

[env]

[deploy]
  release_command = "yarn prisma migrate deploy"
# Dockerfile.migration
### BASE ###
FROM node:16.14.0-alpine AS base

WORKDIR /app

RUN npm install prisma@3 --force
COPY ./api/prisma/ ./prisma/

USER node

CMD yarn prisma migrate deploy
2022-05-26T02:24:23.123 runner[323a8ca6] sjc [info] Starting instance
2022-05-26T02:24:23.235 runner[323a8ca6] sjc [info] Configuring virtual machine
2022-05-26T02:24:23.236 runner[323a8ca6] sjc [info] Pulling container image
2022-05-26T02:24:30.571 runner[323a8ca6] sjc [info] Unpacking image
2022-05-26T02:24:32.789 runner[323a8ca6] sjc [info] Preparing kernel init
2022-05-26T02:24:34.491 runner[323a8ca6] sjc [info] Configuring firecracker
2022-05-26T02:24:34.491 runner[323a8ca6] sjc [info] Starting virtual machine
2022-05-26T02:24:34.697 app[323a8ca6] sjc [info] Starting init (commit: aa54f7d)...
2022-05-26T02:24:34.725 app[323a8ca6] sjc [info] Preparing to run: `docker-entrypoint.sh yarn prisma migrate deploy` as node
2022-05-26T02:24:34.739 app[323a8ca6] sjc [info] 2022/05/26 02:24:34 listening on [fdaa:0:4e75:a7b:a160:323a:8ca6:2]:22 (DNS: [fdaa::3]:53)
2022-05-26T02:24:35.341 app[323a8ca6] sjc [info] yarn run v1.22.17
2022-05-26T02:24:35.362 app[323a8ca6] sjc [info] warning package.json: No license field
2022-05-26T02:24:35.379 app[323a8ca6] sjc [info] $ /app/node_modules/.bin/prisma migrate deploy
2022-05-26T02:24:36.046 app[323a8ca6] sjc [info] Prisma schema loaded from prisma/schema.prisma
2022-05-26T02:24:36.096 app[323a8ca6] sjc [info] Datasource "db": PostgreSQL database "postgres", schema "public" at "*************.internal:5432"
2022-05-26T02:24:36.185 app[323a8ca6] sjc [info] 81 migrations found in prisma/migrations
2022-05-26T02:24:37.023 app[323a8ca6] sjc [info] No pending migrations to apply.
2022-05-26T02:24:37.077 app[323a8ca6] sjc [info] Done in 1.74s.
2022-05-26T02:24:37.737 app[323a8ca6] sjc [info] Main child exited normally with code: 0
2022-05-26T02:24:37.738 app[323a8ca6] sjc [info] Starting clean up.
2022-05-26T02:24:51.876 runner[72638e8e] sjc [info] Starting instance
2022-05-26T02:24:51.958 runner[72638e8e] sjc [info] Configuring virtual machine
2022-05-26T02:24:51.960 runner[72638e8e] sjc [info] Pulling container image
2022-05-26T02:24:52.282 runner[72638e8e] sjc [info] Unpacking image
2022-05-26T02:24:52.288 runner[72638e8e] sjc [info] Preparing kernel init
2022-05-26T02:24:53.945 runner[72638e8e] sjc [info] Configuring firecracker
2022-05-26T02:24:54.037 runner[72638e8e] sjc [info] Starting virtual machine
2022-05-26T02:24:54.214 app[72638e8e] sjc [info] Starting init (commit: aa54f7d)...
2022-05-26T02:24:54.258 app[72638e8e] sjc [info] 2022/05/26 02:24:54 listening on [fdaa:0:4e75:a7b:a160:7263:8e8e:2]:22 (DNS: [fdaa::3]:53)
2022-05-26T02:24:54.834 app[72638e8e] sjc [info] yarn run v1.22.17
2022-05-26T02:24:54.855 app[72638e8e] sjc [info] warning package.json: No license field
2022-05-26T02:24:54.872 app[72638e8e] sjc [info] $ /app/node_modules/.bin/prisma migrate deploy
2022-05-26T02:24:55.785 app[72638e8e] sjc [info] Prisma schema loaded from prisma/schema.prisma
2022-05-26T02:24:55.845 app[72638e8e] sjc [info] Datasource "db": PostgreSQL database "postgres", schema "public" at "*****************.internal:5432"
2022-05-26T02:24:56.966 app[72638e8e] sjc [info] 81 migrations found in prisma/migrations
2022-05-26T02:24:57.777 app[72638e8e] sjc [info] No pending migrations to apply.
2022-05-26T02:24:57.819 app[72638e8e] sjc [info] Done in 2.99s.
2022-05-26T02:24:58.256 app[72638e8e] sjc [info] Main child exited normally with code: 0
2022-05-26T02:24:58.256 app[72638e8e] sjc [info] Starting clean up.
2022-05-26T02:25:05.309 runner[72638e8e] sjc [info] Starting instance
2022-05-26T02:25:05.392 runner[72638e8e] sjc [info] Configuring virtual machine
2022-05-26T02:25:05.393 runner[72638e8e] sjc [info] Pulling container image
2022-05-26T02:25:05.725 runner[72638e8e] sjc [info] Unpacking image
2022-05-26T02:25:05.730 runner[72638e8e] sjc [info] Preparing kernel init
2022-05-26T02:25:07.431 runner[72638e8e] sjc [info] Configuring firecracker
2022-05-26T02:25:07.526 runner[72638e8e] sjc [info] Starting virtual machine
2022-05-26T02:25:07.740 app[72638e8e] sjc [info] Starting init (commit: aa54f7d)...
2022-05-26T02:25:07.762 app[72638e8e] sjc [info] Preparing to run: `docker-entrypoint.sh /bin/sh -c yarn prisma migrate deploy` as node
2022-05-26T02:25:07.775 app[72638e8e] sjc [info] 2022/05/26 02:25:07 listening on [fdaa:0:4e75:a7b:a160:7263:8e8e:2]:22 (DNS: [fdaa::3]:53)
2022-05-26T02:25:08.353 app[72638e8e] sjc [info] yarn run v1.22.17
2022-05-26T02:25:08.373 app[72638e8e] sjc [info] warning package.json: No license field
2022-05-26T02:25:08.391 app[72638e8e] sjc [info] $ /app/node_modules/.bin/prisma migrate deploy
2022-05-26T02:25:09.289 app[72638e8e] sjc [info] Prisma schema loaded from prisma/schema.prisma
2022-05-26T02:25:09.355 app[72638e8e] sjc [info] Datasource "db": PostgreSQL database "postgres", schema "public" at "**************.internal:5432"
2022-05-26T02:25:10.505 app[72638e8e] sjc [info] 81 migrations found in prisma/migrations
2022-05-26T02:25:11.447 app[72638e8e] sjc [info] No pending migrations to apply.
2022-05-26T02:25:11.499 app[72638e8e] sjc [info] Done in 3.15s.
2022-05-26T02:25:11.772 app[72638e8e] sjc [info] Main child exited normally with code: 0
2022-05-26T02:25:11.773 app[72638e8e] sjc [info] Starting clean up.
2022-05-26T02:25:18.940 runner[72638e8e] sjc [info] Starting instance
2022-05-26T02:25:19.023 runner[72638e8e] sjc [info] Configuring virtual machine
2022-05-26T02:25:19.024 runner[72638e8e] sjc [info] Pulling container image
2022-05-26T02:25:19.341 runner[72638e8e] sjc [info] Unpacking image
2022-05-26T02:25:19.348 runner[72638e8e] sjc [info] Preparing kernel init
2022-05-26T02:25:20.960 runner[72638e8e] sjc [info] Configuring firecracker
2022-05-26T02:25:21.137 runner[72638e8e] sjc [info] Starting virtual machine
2022-05-26T02:25:21.371 app[72638e8e] sjc [info] Starting init (commit: aa54f7d)...
2022-05-26T02:25:21.393 app[72638e8e] sjc [info] Preparing to run: `docker-entrypoint.sh /bin/sh -c yarn prisma migrate deploy` as node
2022-05-26T02:25:21.407 app[72638e8e] sjc [info] 2022/05/26 02:25:21 listening on [fdaa:0:4e75:a7b:a160:7263:8e8e:2]:22 (DNS: [fdaa::3]:53)
2022-05-26T02:25:21.995 app[72638e8e] sjc [info] yarn run v1.22.17
2022-05-26T02:25:22.016 app[72638e8e] sjc [info] warning package.json: No license field
2022-05-26T02:25:22.033 app[72638e8e] sjc [info] $ /app/node_modules/.bin/prisma migrate deploy
2022-05-26T02:25:22.935 app[72638e8e] sjc [info] Prisma schema loaded from prisma/schema.prisma
2022-05-26T02:25:23.001 app[72638e8e] sjc [info] Datasource "db": PostgreSQL database "postgres", schema "public" at "***********.internal:5432"
2022-05-26T02:25:23.123 app[72638e8e] sjc [info] 81 migrations found in prisma/migrations
2022-05-26T02:25:23.935 app[72638e8e] sjc [info] No pending migrations to apply.
2022-05-26T02:25:23.992 app[72638e8e] sjc [info] Done in 2.01s.
2022-05-26T02:25:24.404 app[72638e8e] sjc [info] Main child exited normally with code: 0
2022-05-26T02:25:24.404 app[72638e8e] sjc [info] Starting clean up.
1 Like