-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from FalkorDB/25-create-separate-service-plan-…
…per-pr 25 create separate service plan per pr
- Loading branch information
Showing
7 changed files
with
105 additions
and
116 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
.github/actions/delete-omnistrate-service-plan/action.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Delete Omnistrate Service Plan | ||
description: "Delete an Omnistrate service plan" | ||
|
||
inputs: | ||
username: | ||
description: "The username to use for authentication" | ||
required: true | ||
password: | ||
description: "The password to use for authentication" | ||
required: true | ||
service-id: | ||
description: "The ID of the service" | ||
required: true | ||
environment-id: | ||
description: "The ID of the environment" | ||
required: true | ||
product-tier-name: | ||
description: "The name of the product tier to delete" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Login | ||
shell: bash | ||
run: | | ||
curl "https://api.omnistrate.cloud/2022-09-01-00/signin" \ | ||
-X POST \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"email\":\"${{ inputs.username }}\",\"password\":\"${{ inputs.password }}\"}" \ | ||
-o token.json | ||
echo "OMNISTRATE_TOKEN=$(jq -r .jwtToken token.json)" >> $GITHUB_ENV | ||
- name: Find product tier ID | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y jq | ||
curl "https://api.omnistrate.cloud/2022-09-01-00/service/${{ inputs.service-id }}/environment/${{ inputs.environment-id }}/service-plan" \ | ||
-X GET \ | ||
-H "Authorization: Bearer $OMNISTRATE_TOKEN" \ | ||
-o service-plans.json | ||
jq -r ".servicePlans[] | select(.productTierName == \"${{ inputs.product-tier-name }}\") | .id" service-plans.json > product-tier-id.txt | ||
echo "PRODUCT_TIER_ID=$(cat product-tier-id.txt)" >> $GITHUB_ENV | ||
- name: Delete product tier | ||
shell: bash | ||
run: | | ||
curl "https://api.omnistrate.cloud/2022-09-01-00/service/${{ inputs.service-id }}/product-tier/${{ env.PRODUCT_TIER_ID }}" \ | ||
-X DELETE \ | ||
-H "Authorization: Bearer $OMNISTRATE_TOKEN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Delete Omnistrate Service Plan | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [closed] | ||
delete: | ||
|
||
jobs: | ||
delete-service-plan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Delete Service Plan | ||
uses: ./.github/actions/delete-omnistrate-service-plan | ||
continue-on-error: true | ||
with: | ||
username: ${{ secrets.OMNISTRATE_USERNAME }} | ||
password: ${{ secrets.OMNISTRATE_PASSWORD }} | ||
service-id: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }} | ||
environment-id: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT }} | ||
product-tier-name: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters