diff --git a/.github/workflows/rollout_all.yml b/.github/workflows/rollout_all.yml new file mode 100644 index 0000000..ea81e60 --- /dev/null +++ b/.github/workflows/rollout_all.yml @@ -0,0 +1,41 @@ +name: Rollout Changes +on: + workflow_dispatch: + # push: + # branches: + # - main + # - dev + +jobs: + bindplane: + runs-on: "ubuntu-22.04" + steps: + - name: Check out source code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - run: mkdir download + + - name: Install BindPlane CLI + run: | + curl -o bindplane.zip https://storage.googleapis.com/bindplane-op-releases/bindplane/latest/bindplane-ee-linux-amd64.zip + unzip bindplane.zip + sudo chmod +x bindplane + sudo mv bindplane /usr/local/bin/bindplane + working-directory: download + + - name: Create Profile + run: | + bindplane profile set gitflow \ + --remote-url https://app.bindplane.com \ + --api-key ${{ secrets.BINDPLANE_API_KEY }} + bindplane profile use gitflow + + - name: Test CLI + run: bindplane version + + - name: Rollout Changes + run: | + cd gitops_workflow_standard + bash ./rollout_bindplane_configs.sh diff --git a/gitops_workflow_standard/rollout_bindplane_configs.sh b/gitops_workflow_standard/rollout_bindplane_configs.sh new file mode 100755 index 0000000..720f341 --- /dev/null +++ b/gitops_workflow_standard/rollout_bindplane_configs.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Directory to start the search; default is the current directory +start_directory="./bindplane/configuration" + +mkdir -p "${start_directory}" + +bindplane_output=$(bindplane get configs") + +# Parse the NAME field from the output and loop through each one +echo "$bindplane_output" | awk 'NR>1 {print $1}' | while read -r name; do + bindplane rollout start "$name" +done + +echo "Configuration rollout started." +