mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-25 13:18:47 +00:00
fix(ci): deploy postgres/mongo instead of start
The create step was calling postgres.start / mongo.start immediately after create. In Dokploy, .start only scales an already-deployed Swarm service; on a freshly created resource the service doesn't exist yet, so the server ran 'docker service scale ci-pg-db-xxx=1' against a missing service and returned a 500 (curl -sf → exit 22 → step failure). .deploy is the mutation that actually builds and creates the Swarm service. Applications already used .deploy correctly; this aligns the databases.
This commit is contained in:
@@ -239,7 +239,9 @@ jobs:
|
|||||||
\"dockerImage\":\"postgres:15\",\"environmentId\":\"$ENV_ID\"}")
|
\"dockerImage\":\"postgres:15\",\"environmentId\":\"$ENV_ID\"}")
|
||||||
echo "postgres.create → $PG"
|
echo "postgres.create → $PG"
|
||||||
PG_ID=$(echo "$PG" | jq -r '.result.data.json.postgresId')
|
PG_ID=$(echo "$PG" | jq -r '.result.data.json.postgresId')
|
||||||
trpc_mut postgres.start "{\"postgresId\":\"$PG_ID\"}" > /dev/null
|
# deploy (not start) — deploy creates the Swarm service; start only
|
||||||
|
# scales an already-deployed service and 500s on a fresh resource.
|
||||||
|
trpc_mut postgres.deploy "{\"postgresId\":\"$PG_ID\"}" > /dev/null
|
||||||
echo "pg_id=$PG_ID" >> "$GITHUB_OUTPUT"
|
echo "pg_id=$PG_ID" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# --- MongoDB 7.0 ---
|
# --- MongoDB 7.0 ---
|
||||||
@@ -250,7 +252,7 @@ jobs:
|
|||||||
\"dockerImage\":\"mongo:7.0\",\"environmentId\":\"$ENV_ID\"}")
|
\"dockerImage\":\"mongo:7.0\",\"environmentId\":\"$ENV_ID\"}")
|
||||||
echo "mongo.create → $MG"
|
echo "mongo.create → $MG"
|
||||||
MG_ID=$(echo "$MG" | jq -r '.result.data.json.mongoId')
|
MG_ID=$(echo "$MG" | jq -r '.result.data.json.mongoId')
|
||||||
trpc_mut mongo.start "{\"mongoId\":\"$MG_ID\"}" > /dev/null
|
trpc_mut mongo.deploy "{\"mongoId\":\"$MG_ID\"}" > /dev/null
|
||||||
echo "mg_id=$MG_ID" >> "$GITHUB_OUTPUT"
|
echo "mg_id=$MG_ID" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# --- Docker-image application helper ---
|
# --- Docker-image application helper ---
|
||||||
|
|||||||
Reference in New Issue
Block a user