Skip to content

update #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/4-bb-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ jobs:
-d "{\"title\":\"\",\"content\":\"$SQL_CONTENT\",\"type\":\"TYPE_SQL\",\"source\":\"SOURCE_BYTEBASE_ARTIFACT\",\"visibility\":\"VISIBILITY_PUBLIC\"}")

SHEET_NAME=$(echo "$sheet_response" | jq -r '.name')
if [ -z "$SHEET_NAME" ] || [ "$SHEET_NAME" = "null" ]; then
echo "Error creating sheet. Response: $sheet_response"
exit 1
fi
echo "Sheet created: $SHEET_NAME"

# Create Plan
Expand All @@ -109,7 +113,12 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"steps\":[{\"specs\":[{\"id\":\"$STEP_ID\",\"export_data_config\":{\"target\":\"/instances/$INSTANCE/databases/$DATABASE\",\"format\":\"$FORMAT\",\"sheet\":\"$SHEET_NAME\"}}]}],\"title\":\"Export data from $DATABASE\",\"description\":\"EXPORT\"}")

echo "Plan response: $plan_response" # Debug output
PLAN_NAME=$(echo "$plan_response" | jq -r '.name')
if [ -z "$PLAN_NAME" ] || [ "$PLAN_NAME" = "null" ]; then
echo "Error creating plan. Response: $plan_response"
exit 1
fi
echo "Plan created: $PLAN_NAME"

# Create Issue
Expand All @@ -119,6 +128,11 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"approvers\":[],\"approvalTemplates\":[],\"subscribers\":[],\"title\":\"Issue: Export data from instances/$INSTANCE/databases/$DATABASE\",\"description\":\"SQL request from GitHub\",\"type\":\"DATABASE_DATA_EXPORT\",\"assignee\":\"\",\"plan\":\"$PLAN_NAME\"}")

echo "Issue response: $issue_response" # Debug output
if ! echo "$issue_response" | jq -e '.name' > /dev/null; then
echo "Error creating issue. Response: $issue_response"
exit 1
fi
ISSUE_NUMBER=$(echo "$issue_response" | jq -r '.name | split("/")[-1]')
ISSUE_LINK="${{ secrets.BYTEBASE_URL }}/projects/$PROJECT/issues/$ISSUE_NUMBER"
echo "Issue created: $ISSUE_LINK"
Expand All @@ -130,6 +144,11 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"plan\":\"$PLAN_NAME\"}")

echo "Rollout response: $rollout_response" # Debug output
if ! echo "$rollout_response" | jq -e '.name' > /dev/null; then
echo "Error creating rollout. Response: $rollout_response"
exit 1
fi
echo "Rollout created: $(echo "$rollout_response" | jq -r '.name')"
done

Expand Down
Loading