Skip to content

Commit

Permalink
fix(run): make script 'support' podman
Browse files Browse the repository at this point in the history
this should solve the issue seen in the pipeline

containers/podman#1234
  • Loading branch information
georgettica committed Jan 13, 2021
1 parent 56c96e8 commit d17d158
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ CONTAINER_BASE_DIR=/tmp/test
CONTAINER_ENGINE=${CONTAINER_ENGINE:-'docker'}
IMG=${IMG:-'quay.io/rogreen/bookmark-generator:latest'}
OUTPUT_HTML_FILE=${OUTPUT_FILE:-'bookmark.html'}
ADDITIONAL_CONTAINER_ENGINE_ARGS=${ADDITIONAL_CONTAINER_ENGINE_ARGS:-}

if [[ "${CONTAINER_ENGINE}" == 'podman' ]]; then
ADDITIONAL_CONTAINER_ENGINE_ARGS="${ADDITIONAL_CONTAINER_ENGINE_ARGS} --net=host"
fi

${CONTAINER_ENGINE} run \
--rm \
--interactive \
--tty \
--volume \
$(pwd):${CONTAINER_BASE_DIR}/data \
${IMG} \
"$(pwd)":${CONTAINER_BASE_DIR}/data \
"${ADDITIONAL_CONTAINER_ENGINE_ARGS}" \
"${IMG}" \
python3 \
bookmark_generator.py \
data/sample.yaml > ${OUTPUT_HTML_FILE}
data/sample.yaml > "${OUTPUT_HTML_FILE}"

0 comments on commit d17d158

Please sign in to comment.