Skip to content

Commit

Permalink
Populate digest after push. Refactor tests to use contains for checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Gohr committed Dec 14, 2019
1 parent be578a6 commit ae6a789
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 105 deletions.
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function main() {
else
pushWithoutSnapshot
fi
echo ::set-output name=tag::"${TAG}"
echo "::set-output name=tag::${TAG}"
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${DOCKERNAME})
echo "::set-output name=digest::${DIGEST}"

docker logout
}
Expand Down
6 changes: 5 additions & 1 deletion mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ function mockShouldFail() {
}

source mockReturns
if [ ! -z "${MOCK_RETURNS[${binary}]}" ]; then
if [ ! -z "${MOCK_RETURNS[${binary}]}" ] || [ ! -z "${MOCK_RETURNS[${binary} $1]}" ]; then
if mockShouldFail ; then
exit 1
fi
if [ ! -z "${MOCK_RETURNS[${binary} $1]}" ]; then
echo ${MOCK_RETURNS[${binary} $1]}
exit 0
fi
echo ${MOCK_RETURNS[${binary}]}
fi

Expand Down
Loading

0 comments on commit ae6a789

Please sign in to comment.