mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 15:53:06 +00:00
Merge pull request '[deploy-opentofu]' (#222) from fenix-admin into main
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#222
This commit is contained in:
@ -37,12 +37,12 @@ jobs:
|
||||
with:
|
||||
path: infra/iac
|
||||
|
||||
#- name: cloning iac secrets repository
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# repository: fenix-gitea-admin/iac-opentofu-private-secrets
|
||||
# token: ${{ secrets.GGITEA_TOKEN }}
|
||||
# path: infra/secrets
|
||||
- name: cloning iac secrets repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: fenix-gitea-admin/iac-opentofu-private-secrets
|
||||
token: ${{ secrets.GGITEA_TOKEN }}
|
||||
path: infra/secrets
|
||||
|
||||
|
||||
- name: Install cloudflare prerequisites
|
||||
@ -126,26 +126,26 @@ jobs:
|
||||
BW_SESSION=$(bw login)
|
||||
|
||||
|
||||
- name: vaultwarden getsecrets
|
||||
working-directory: infra/iac
|
||||
run: |
|
||||
BW_SESSION2=$(bw unlock --raw --session "$BW_SESSION")
|
||||
# Ler o arquivo de referência
|
||||
for secret in $(jq -c '.secrets[]' secrets/vault-secrets-map.json); do
|
||||
name=$(echo "$secret" | jq -r '.name')
|
||||
type=$(echo "$secret" | jq -r '.type')
|
||||
output=$(echo "$secret" | jq -r '.output')
|
||||
echo "$name $type $output"
|
||||
item_id=$(bw get item "$name" --session "$BW_SESSION2" | jq -r '.id')
|
||||
echo "$item_id"
|
||||
if [ "$type" == "attachment" ]; then
|
||||
echo "attachment get"
|
||||
bw get attachment "$output" --itemid "$item_id" --output "$output"
|
||||
elif [ "$type" == "note" ]; then
|
||||
echo "note get"
|
||||
bw get item "$name" | jq -r '.notes' > "$output"
|
||||
fi
|
||||
done
|
||||
#- name: vaultwarden getsecrets
|
||||
# working-directory: infra/iac
|
||||
# run: |
|
||||
# BW_SESSION2=$(bw unlock --raw --session "$BW_SESSION")
|
||||
# # Ler o arquivo de referência
|
||||
# for secret in $(jq -c '.secrets[]' secrets/vault-secrets-map.json); do
|
||||
# name=$(echo "$secret" | jq -r '.name')
|
||||
# type=$(echo "$secret" | jq -r '.type')
|
||||
# output=$(echo "$secret" | jq -r '.output')
|
||||
# echo "$name $type $output"
|
||||
# item_id=$(bw get item "$name" --session "$BW_SESSION2" | jq -r '.id')
|
||||
# echo "$item_id"
|
||||
# if [ "$type" == "attachment" ]; then
|
||||
# echo "attachment get"
|
||||
# bw get attachment "$output" --itemid "$item_id" --output "$output"
|
||||
# elif [ "$type" == "note" ]; then
|
||||
# echo "note get"
|
||||
# bw get item "$name" | jq -r '.notes' > "$output"
|
||||
# fi
|
||||
# done
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
|
||||
Reference in New Issue
Block a user