Builds API

Builds API

API로 빌드를 생성해 애플리케이션을 배포하세요.

GET/organizations/:orgId/projects/:projectId/endpoints

프로젝트의 라이브 URL 목록을 평면 배열로 반환합니다 — 기본 URL과 연결(활성)된 커스텀 도메인이 함께 포함됩니다.

응답
{
  "endpoints": [
    "https://abc123.justdeploy.site",
    "https://www.example.com"
  ]
}
GET/organizations/:orgId/projects/:projectId/builds

프로젝트의 최근 빌드 목록을 반환합니다(최대 50개).

응답
{
  "builds": [
    {
      "id": "b1234567-abcd-...",
      "commit": null,
      "version": "1.0.0",
      "runtime": "nodejs22.x",
      "size": 524288,
      "status": "ready",
      "error": null,
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ]
}
POST/organizations/:orgId/projects/:projectId/builds

새 빌드를 생성합니다. 애플리케이션 코드를 .zip 파일로 업로드할 수 있는 presigned URL을 반환합니다.

응답
{
  "build": {
    "id": "b2345678-efgh-...",
    "commit": null,
    "version": null,
    "runtime": null,
    "size": null,
    "status": "pending",
    "error": null,
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-20T..."
  },
  "url": "https://upload.justdeploy.net/..." // Presigned upload URL
}

presigned URL로 zip 파일을 업로드하세요:

업로드
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/zip" \
  --data-binary @app.zip

같은 프로젝트에서 이미 빌드가 진행 중이면 409 Conflict와 함께 기존 빌드를 반환합니다. 해당 빌드를 폴링하고 완료된 뒤 다시 시도하세요.

Conflict 응답(409)
{
  "status": "Conflict",
  "message": "A build is already in progress for this project.",
  "build": {
    "id": "b1234567-abcd-...",
    "status": "building",
    "createdAt": "2026-05-05T..."
  }
}
GET/organizations/:orgId/projects/:projectId/builds/:buildId

빌드 상태를 확인합니다. 상태가 ready 또는 error가 될 때까지 이 엔드포인트를 폴링하세요.

응답
{
  "build": {
    "id": "b2345678-efgh-...",
    "commit": null,
    "version": "1.0.0",
    "runtime": "nodejs22.x",
    "size": 524288,
    "status": "ready",
    "error": null,
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-20T..."
  }
}

전체 배포 흐름

전체 예시
# 1. Create a build
BUILD=$(curl -s -X POST \
  "https://api.justdeploy.net/organizations/ORG_ID/projects/PROJECT_ID/builds" \
  -H "X-Access-Key: $ACCESS_KEY" \
  -H "X-Secret-Key: $SECRET_KEY")

UPLOAD_URL=$(echo $BUILD | jq -r '.url')
BUILD_ID=$(echo $BUILD | jq -r '.build.id')

# 2. Upload your code
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/zip" \
  --data-binary @app.zip

# 3. Poll for completion
curl -s \
  "https://api.justdeploy.net/organizations/ORG_ID/projects/PROJECT_ID/builds/$BUILD_ID" \
  -H "X-Access-Key: $ACCESS_KEY" \
  -H "X-Secret-Key: $SECRET_KEY"

지원 런타임

JustDeploy는 프로젝트의 런타임을 자동으로 감지합니다. 빌드 응답의 runtime 필드는 다음 중 하나입니다:

  • nodejs24.x
  • nodejs22.x
  • python3.14
  • python3.13
  • python3.12
  • java21
  • java17