Skip to content

Commit

Permalink
changed init container version to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matan1811 committed Apr 2, 2019
1 parent 939ff11 commit eedf57e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion init-container/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "init-decryptor",
"version": "0.0.4",
"version": "1.0.0",
"description": "Meant to be used inside init container to read encrypted values from a given folder and decrypt to them into a json in a given folder",
"main": "index.js",
"scripts": {
Expand Down
67 changes: 67 additions & 0 deletions init-container/tests/run_test_multiple_folders.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash

set -e

echo "Removing otput directory"

rm -rf output

echo "starting wiremock"

docker-compose up -d --build wiremock

docker-compose build decryptor

echo "running decryptor - json format"

OUTPUT_FORMAT=json docker-compose run decryptor

echo "comparing out.json and expected.json files"

diff -q output/out.json expected.json

rm -rf output

echo "running decryptor - cfg format"

OUTPUT_FORMAT=cfg docker-compose run decryptor

echo "comparing out.cfg and expected.cfg files"

diff -q output/out.cfg expected.cfg

rm -rf output

echo "running decryptor - cfg strict format"

OUTPUT_FORMAT=cfg-strict docker-compose run decryptor

echo "comparing out.cfg-strict and expected-strict.cfg files"

diff -q output/out.cfg-strict expected-strict.cfg

rm -rf output

echo "running decryptor - files format"

OUTPUT_FORMAT=files docker-compose run decryptor

echo "comparing output directory with expected.json"

for f in "output"/*; do
output=$(cat "$f")
expected=$(cat expected.json | jq .$(basename $f) | sed -e 's/^"//' -e 's/"$//') # remove double qoutes because they doesn't exist in files
diff <(echo $output) <(echo $expected)
done

rm -rf output

echo "running decryptor - upper case"

OUTPUT_FORMAT=JSON docker-compose run decryptor

if [[ $? != 0 ]]
then
echo "should not fail on upper case format"
exit 1
fi

0 comments on commit eedf57e

Please sign in to comment.