ensure that emitted versions are the same across in/out/check

This commit is contained in:
Aidan Feldman 2016-03-10 12:35:56 -05:00
parent f3ce24d31d
commit 17689c1c1a
6 changed files with 14 additions and 16 deletions

View file

@ -14,4 +14,4 @@ Requires Docker.
1. Modify `config.json`.
* See [the instructions for getting your AWS credentials](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html#cli-signup).
* Exclude the `s3://` prefix/protocol for the `bucket`.
1. Run `./test/run </full/path/to/dir/or/file>`.
1. Run `./test/out </full/path/to/dir/or/file>`.

View file

@ -4,8 +4,5 @@
set -e
echo "[
{
\"timestamp\": \"foo\"
}
]"
# pretend that "the given version is already the latest"
echo "[]"

8
assets/emit.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
# give back a(n empty) version, so that the check passes when using `in`/`out`
echo "{
\"version\": {}
}"

View file

@ -33,8 +33,4 @@ aws s3 sync "s3://$bucket" $dest
echo "...done."
# use a hard-coded version, so that the check passes
jq -n "{
version: {
timestamp: \"foo\"}
}" >&3
source "$(dirname $0)/emit.sh" >&3

View file

@ -17,6 +17,7 @@ if [ -z "$source" ]; then
fi
#######################################
# parse incoming config data
payload=`cat`
bucket=$(echo "$payload" | jq -r '.source.bucket')
@ -33,8 +34,4 @@ aws s3 sync $source "s3://$bucket"
echo "...done."
# use a hard-coded version, so that the check passes
jq -n "{
version: {
timestamp: \"foo\"}
}" >&3
source "$(dirname $0)/emit.sh" >&3

View file