From a1a29c8ef45e1d45c1b77cd8ec4688b1529fded3 Mon Sep 17 00:00:00 2001 From: subash adhikari Date: Fri, 7 Oct 2022 09:49:57 +1100 Subject: [PATCH] doc: add example script --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 3a660fd..2bb91e0 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,25 @@ Flags: Use "safebox [command] --help" for more information about a command. ``` +### Using in scripts + +``` +#!/bin/bash + +set -euo pipefail + +echo "📦 deploying configs to ssm" +yarn safebox deploy --stage $STAGE # ensures all configs are deployed. throws error if ay configs are missings + +configs=$(yarn safebox export --stage $STAGE) +CONFIG1=$(echo "$configs" | jq -r ".CONFIG1") +CONFIG2=$(echo "$configs" | jq -r '.CONFIG2') + +echo $CONFIG1 +echo $CONFIG2 + +``` + ### License Feel free to use the code, it's released using the MIT license.