mirror of
https://github.com/langgenius/dify.git
synced 2025-12-19 17:27:16 -05:00
Feat/enteprise cd (#25508)
This commit is contained in:
26
.github/workflows/deploy-enterprise.yml
vendored
26
.github/workflows/deploy-enterprise.yml
vendored
@@ -24,18 +24,18 @@ jobs:
|
||||
DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }}
|
||||
DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }}
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user