From f96803b9be8fdf15013efd920865054e2fa90947 Mon Sep 17 00:00:00 2001 From: fenix-gitea-admin Date: Sun, 7 Sep 2025 21:54:18 +0000 Subject: [PATCH] [deploy-opentofu] --- .gitea/workflows/ci-test.yaml | 44 ++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/ci-test.yaml b/.gitea/workflows/ci-test.yaml index ac18839..9dddea0 100644 --- a/.gitea/workflows/ci-test.yaml +++ b/.gitea/workflows/ci-test.yaml @@ -123,29 +123,31 @@ jobs: - name: vaultwarden login working-directory: infra/iac run: | - BW_SESSION=$(bw login) + #BW_SESSION=$(bw login) + bw login + BW_SESSION=$(bw unlock --raw) - #- 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" | 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