Skip to content

Commit

Permalink
Add some smoke testing to docker image
Browse files Browse the repository at this point in the history
and correct the entrypoint file to correctly exec and use a shell that exists on
the base alpine image
  • Loading branch information
Dan Buch committed Sep 18, 2016
1 parent 3a89066 commit de31552
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .docker-entrypoint.sh
@@ -1,6 +1,8 @@
#!/bin/bash
#!/bin/sh
set -e

if [ "${1:0:1}" = '-' ]; then
set -- travis-worker "$@"
fi

exec "$@"
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -45,6 +45,7 @@ script:
- make smoke
- if [[ $TRAVIS_PULL_REQUEST = 'false' && $QUAY_DOCKER_LOGIN_PASSWORD && $QUAY_DOCKER_LOGIN_USERNAME ]]; then
make docker-build &&
make docker-smoke &&
make docker-push;
fi
- if [[ $TRAVIS_PULL_REQUEST = 'false' && $PACKAGECLOUD_TOKEN ]]; then
Expand Down
22 changes: 22 additions & 0 deletions utils/docker-smoke
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -o errexit

main() {
[[ ${DOCKER_DEST} ]] || {
__log error="missing \$DOCKER_DEST"
exit 1
}

set -o xtrace
docker run --rm "${DOCKER_DEST}" --version &>/dev/null
docker run --rm "${DOCKER_DEST}" travis-worker --version &>/dev/null
docker run --rm "${DOCKER_DEST}" --help &>/dev/null
docker run --rm "${DOCKER_DEST}" travis-worker --help &>/dev/null
}

__log() {
echo "time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$@"
}

main "$@"

0 comments on commit de31552

Please sign in to comment.