Browse Source

Feat/enteprise cd (#25508)

tags/1.9.0
Xiyuan Chen 1 month ago
parent
commit
af7f67dc9c
No account linked to committer's email address
1 changed files with 13 additions and 13 deletions
  1. 13
    13
      .github/workflows/deploy-enterprise.yml

+ 13
- 13
.github/workflows/deploy-enterprise.yml View File

DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }} DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }}
DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }} DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }}
run: | run: |
IFS=',' read -ra ENDPOINTS <<< "$DEV_ENV_ADDRS"
IFS=',' read -ra ENDPOINTS <<< "${DEV_ENV_ADDRS:-}"
BODY='{"project":"dify-api","tag":"deploy-enterprise"}'

for ENDPOINT in "${ENDPOINTS[@]}"; do for ENDPOINT in "${ENDPOINTS[@]}"; do
ENDPOINT=$(echo "$ENDPOINT" | xargs)
BODY=$(cat <<EOF
{
"project": "dify-api",
"tag": "deploy-enterprise"
}
EOF
)
API_SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}')
curl -X POST -H "Content-Type: application/json" -H "X-Hub-Signature-256: $API_SIGNATURE" -d "$BODY" "$ENDPOINT"
ENDPOINT="$(echo "$ENDPOINT" | xargs)"
[ -z "$ENDPOINT" ] && continue

API_SIGNATURE=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}')

curl -sSf -X POST \
-H "Content-Type: application/json" \
-H "X-Hub-Signature-256: $API_SIGNATURE" \
-d "$BODY" \
"$ENDPOINT"
done done

Loading…
Cancel
Save