forked from jsirianni/bindplane-gitflow-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
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,49 @@ | ||
name: BindPlane OP Deploy and Export Raw | ||
on: | ||
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/bindplane-ee-v1.30.0-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: Deploy Resources | ||
run: bash ./apply_bindplane_configs.sh | ||
|
||
- name: Export and checkin otel | ||
run: bash ./get_bindplane_otel_configs.sh | ||
|
||
- name: Commit and Push Changes | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git add -A | ||
git commit -m "Automated changes" | ||
git push |
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,7 @@ | ||
#!/bin/bash | ||
|
||
# Directory to start the search; default is the current directory | ||
start_directory="./bindplane" | ||
|
||
# Use find command to locate all yaml files and execute bindplane apply on each | ||
find "$start_directory" -name "*.yaml" -type f -exec echo "Applying {}" \; -exec bindplane apply -f {} \; |
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,27 @@ | ||
#!/bin/bash | ||
|
||
# Define the template, source, and output directories | ||
SOURCE_DIR="source" | ||
OUTPUT_DIR="bindplane" | ||
|
||
# Array of commands to automatically execute | ||
declare -a commands=("configuration" "account" "destination" "user") | ||
|
||
for command in "${commands[@]}"; do | ||
# Create a directory for each command's output | ||
mkdir -p "${OUTPUT_DIR}/$command" | ||
|
||
# Fetch the list for the current command from bindplane | ||
bindplane_output=$(bindplane get "${command}s") # Appending 's' to get the list | ||
|
||
# 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 | ||
# Fetch the YAML detail for each NAME | ||
yaml_output=$(bindplane get "$command" "$name" -o yaml) | ||
|
||
# Save the YAML detail to a file in the OUTPUT folder | ||
echo "$yaml_output" > "${OUTPUT_DIR}/$command/${name}.yaml" | ||
done | ||
done | ||
|
||
echo "Completed exporting all configuration files. Results saved to: $OUTPUT_DIR" |
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,22 @@ | ||
#!/bin/bash | ||
|
||
# Define the template, source, and output directories | ||
SOURCE_DIR="source" | ||
OUTPUT_DIR="bindplane_otel" | ||
|
||
# Create a directory for each command's output | ||
mkdir -p "${OUTPUT_DIR}" | ||
|
||
# Fetch the list for the current command from bindplane | ||
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 | ||
# Fetch the YAML detail for each NAME | ||
yaml_output=$(bindplane get config "$name" -o raw) | ||
|
||
# Save the YAML detail to a file in the OUTPUT folder | ||
echo "$yaml_output" > "${OUTPUT_DIR}/${name}.yaml" | ||
done | ||
|
||
echo "Completed exporting all configuration files. Results saved to: $OUTPUT_DIR" |