Skip to Content
문서통합

통합

Deplite는 외부 시스템과 다음과 같이 통합돼요.

S3 호환 스토리지

워크플로우 입출력 파일을 보관하기 위한 스토리지 바인딩이에요.
AWS S3, Cloudflare R2, MinIO 등 S3 호환 서비스를 모두 사용할 수 있어요.

바인딩 생성

대시보드의 Storage → New binding에서 다음을 입력해요.

필드
Nameprod-artifacts
Endpointhttps://s3.amazonaws.com
Regionap-northeast-2
Bucketmyapp-deplite
Access KeyAKIA...
Secret Key(마스킹)

업로드 흐름 (Presigned URL)

# 1. 사전 서명 URL 받기 curl -X POST .../orgs/<orgId>/files/presign-upload \ -H "Authorization: Bearer $JWT" \ -d '{"bindingId": "...", "fileName": "build.tar.gz", "contentType": "application/gzip"}' # → { fileId, uploadUrl } # 2. URL로 직접 업로드 (S3로 바로) curl -X PUT "<uploadUrl>" --data-binary @build.tar.gz # 3. 완료 알림 curl -X POST .../orgs/<orgId>/files/<fileId>/complete \ -H "Authorization: Bearer $JWT"

Agent에서 다운로드

워크플로우가 실행될 때 입력 파일이 있다면, Agent는 다음으로 다운로드 URL을 받아요.

GET /api/agent/files/<fileId>/download-url # → { downloadUrl, expiresInSeconds }

Agent는 받은 URL로 파일을 받아 ./logs/files/에 캐시해요.

토큰 권한

storage 스코프 API 토큰은 binding별로 read, write, delete를 세분화할 수 있어요.

{ "scopeType": "storage", "bindingIds": ["binding-uuid"], "storagePermissions": ["read", "write"] }

Slack

설치

# 1. 설치 URL 받기 curl .../orgs/<orgId>/slack/install-url \ -H "Authorization: Bearer $JWT" # 2. URL을 브라우저에서 열어 워크스페이스 승인 # 3. 콜백 자동 처리 → 연결 완료

Chat 트리거 (메시지로 실행)

{ "type": "slack", "chatProvider": "slack", "chatTeamId": "T0123", "chatChannelId": "C0123", "chatKeyword": "deploy" }

사용 방식:

  • 앱 멘션: @deplite deploy
  • 슬래시: /deplite deploy

Notify (실행 결과 알림)

어떤 트리거든 결과 알림을 받을 수 있어요.

{ "notifyProvider": "slack", "notifyTeamId": "T0123", "notifyChannelId": "C0456", "notifyOn": "failure" }

notifyOn: always / failure / success / none

메시지 예

[SUCCESS] Job #abc — deploy-prod [SUCCESS] Ref: main · Duration: 2m 34s · Exit Code: 0
[FAILED] Job #def — deploy-prod [FAILED] Ref: feature/x · Duration: 12s · Exit Code: 1 Error: timeout exceeded in step "Push"

Discord

Slack과 거의 동일한 모델이에요.
chatProvider: discord, chatTeamId에 guild ID, chatChannelId에 채널 ID를 입력하세요.

GitHub Actions

Deplite는 GitHub Actions의 표준 step으로도 호출할 수 있어요.

# .github/workflows/deploy.yml name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Trigger Deplite run: | curl -X POST https://api.deplite.io/triggers/${{ secrets.DEPLITE_TRIGGER_ID }}/run \ -H "Authorization: Bearer ${{ secrets.DEPLITE_TOKEN }}" \ -H "Idempotency-Key: ${{ github.run_id }}" \ -d '{ "ref": "${{ github.sha }}", "params": { "actor": "${{ github.actor }}", "repo": "${{ github.repository }}" } }'

이렇게 하면 GitHub의 CI는 그대로 두고, 민감한 배포 단계만 Deplite로 옮길 수 있어요.
“실행은 우리 인프라”라는 원칙은 그대로 지켜져요.

완전한 S3 흐름 예시

빌드 결과물을 업로드 → 다른 워크플로우가 다운로드해서 배포하는 시나리오예요.

1) 빌드 파이프라인에서 업로드

# CI 환경에서 ORG_ID="org-abc"; BINDING="bnd-001"; JWT="$DEPLITE_TOKEN" # [a] presigned upload URL 받기 RESP=$(curl -s -X POST https://app.deplite.io/api/orgs/$ORG_ID/files/presign-upload \ -H "Authorization: Bearer $JWT" \ -d "{ \"bindingId\": \"$BINDING\", \"fileName\": \"app-$GIT_SHA.tar.gz\", \"contentType\": \"application/gzip\" }") FILE_ID=$(echo $RESP | jq -r '.fileId') UPLOAD_URL=$(echo $RESP | jq -r '.uploadUrl') # [b] S3로 직접 PUT (서버 거치지 않음) curl -X PUT "$UPLOAD_URL" \ --upload-file ./dist/app.tar.gz \ -H "Content-Type: application/gzip" # [c] 완료 알림 curl -X POST https://app.deplite.io/api/orgs/$ORG_ID/files/$FILE_ID/complete \ -H "Authorization: Bearer $JWT" echo "Uploaded as $FILE_ID"

2) 배포 워크플로우에서 다운로드

./workflows/deploy-from-artifact.yaml

name: deploy-from-artifact timeout-minutes: 20 steps: - name: download run: | RESP=$(curl -s -H "X-Agent-Signature: ..." \ "https://api.deplite.io/api/agent/files/$PARAMS_FILEID/download-url") URL=$(echo $RESP | jq -r '.downloadUrl') curl -L "$URL" -o /tmp/app.tar.gz - name: extract run: tar -xzf /tmp/app.tar.gz -C /var/www/myapp - name: restart run: systemctl restart myapp

Webhook으로 fileId를 넘겨주면 자동으로 끌어와요.

curl -X POST .../triggers/<id>/run \ -H "Authorization: Bearer tk_..." \ -d "{\"ref\": \"main\", \"params\": {\"FILEID\": \"$FILE_ID\"}}"

Slack 알림 메시지 커스텀

Notification은 기본 템플릿이지만, 워크플로우 마지막 step에서 직접 webhook으로 풍부한 메시지를 보낼 수도 있어요.

steps: - name: deploy run: ./deploy.sh - name: notify run: | cat <<JSON | curl -X POST "$SLACK_WEBHOOK" -H 'Content-Type: application/json' -d @- { "blocks": [ {"type": "header", "text": {"type": "plain_text", "text": "Deploy 완료: $REF"}}, {"type": "section", "fields": [ {"type": "mrkdwn", "text": "*Env:*\n$PARAMS_ENV"}, {"type": "mrkdwn", "text": "*Actor:*\n$PARAMS_ACTOR"} ]}, {"type": "actions", "elements": [ {"type": "button", "text": {"type": "plain_text", "text": "Open App"}, "url": "https://app.example.com"} ]} ] } JSON continue-on-error: true

다음으로

  • API — 모든 스토리지 엔드포인트
  • 트리거 — 트리거별 옵션 정리
최종 수정 일자: