EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 30e0bc66 authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

docker secrets usage

parent 70ea5696
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# jsonenv reads a json object as input and produces
# escaped shell commands for setting environment vars
import json
import pipes
import os
import sys
for k, v in json.load(sys.stdin).items():
k = pipes.quote(k)
v = pipes.quote(v)
print("%s=%s" % (k, v))
\ No newline at end of file
#!/bin/sh
chmode +x env_setup
cat > /run/secrets/my_secret > secrets.json
./env_setup <secrets.json >secrets.csv
IFS="="
while read key value ; do
export $key=$value
echo "${key}=${value}"
done < secrets.csv
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment