Integrasi

Publish Release otomatis dari GitLab CI

Tambah job notify ke .gitlab-ci.yml — release tercatat di Oprex otomatis tiap deploy.

Diperbarui 2026-06-10

Publish Release otomatis dari GitLab CI

Setup

  1. Dapatkan OPREX_INGEST_KEY dari Pengaturan → API Keys di member.oprex.id
  2. Set sebagai CI/CD variable di GitLab project (Settings → CI/CD → Variables), masked
  3. Tambah job ke .gitlab-ci.yml:
publish-release:
  stage: notify
  when: on_success
  allow_failure: true
  image: alpine:latest
  before_script:
    - apk add --no-cache curl jq
  script:
    - |
      curl -sS -X POST "https://oprex.id/api/v1/releases" \
        -H "X-Oprex-Key: $OPREX_INGEST_KEY" \
        -H "Content-Type: application/json" \
        -d "{
          \"appKey\": \"$CI_PROJECT_NAME\",
          \"appName\": \"$CI_PROJECT_TITLE\",
          \"version\": \"$CI_COMMIT_SHORT_SHA\",
          \"title\": \"$CI_COMMIT_TITLE\",
          \"notes\": [\"$CI_COMMIT_MESSAGE\"]
        }"yaml

Script lengkap (idempotent, dgn validation): oprex-publish-release.sh

Belum menemukan jawaban? Hubungi kami