From 06ef820cf94231614dade53e15e72070bd107212 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Thu, 19 Oct 2023 12:28:51 -0400 Subject: [PATCH] Rollout action --- .github/workflows/rollout_all.yml | 41 +++++++++++++++++++ .../rollout_bindplane_configs.sh | 16 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/rollout_all.yml create mode 100755 gitops_workflow_standard/rollout_bindplane_configs.sh 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." +