Skip to content

Commit

Permalink
Merge pull request #99 from mdellweg/update-ci
Browse files Browse the repository at this point in the history
Update run_container.sh
  • Loading branch information
mdellweg authored Apr 19, 2022
2 parents cde306b + 74d9137 commit 3b2345c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ FROM_TAG="${FROM_TAG:-latest}"

if [ "${CONTAINER_FILE:+x}" ]
then
IMAGE_TAG="ephemeral-build"
"${CONTAINER_RUNTIME}" build --file "${BASEPATH}/assets/${CONTAINER_FILE}" --build-arg FROM_TAG="${FROM_TAG}" --tag ghcr.io/pulp/pulp:"${IMAGE_TAG}" .
fi

"${CONTAINER_RUNTIME}" run ${RM:+--rm} --detach --name "pulp-ephemeral" --volume "${BASEPATH}/settings:/etc/pulp" --publish "8080:80" "ghcr.io/pulp/pulp:${IMAGE_TAG}"
"${CONTAINER_RUNTIME}" run ${RM:+--rm} --env S6_KEEP_ENV=1 ${PULP_API_ROOT:+--env PULP_API_ROOT} --detach --name "pulp-ephemeral" --volume "${BASEPATH}/settings:/etc/pulp" --publish "8080:80" "ghcr.io/pulp/pulp:${IMAGE_TAG}"

# shellcheck disable=SC2064
trap "${CONTAINER_RUNTIME} stop pulp-ephemeral" EXIT
Expand All @@ -58,7 +59,7 @@ do
fi

sleep 3
if curl --fail http://localhost:8080/pulp/api/v3/status/ > /dev/null 2>&1
if curl --fail "http://localhost:8080${PULP_API_ROOT:-/pulp/}api/v3/status/" > /dev/null 2>&1
then
echo "SUCCESS."
break
Expand All @@ -67,7 +68,7 @@ do
done

# show pulpcore/plugin versions we're using
curl -s http://localhost:8080/pulp/api/v3/status/ | jq '.versions|map({key: .component, value: .version})|from_entries'
curl -s "http://localhost:8080${PULP_API_ROOT:-/pulp/}api/v3/status/" | jq '.versions|map({key: .component, value: .version})|from_entries'

# Set admin password
"${CONTAINER_RUNTIME}" exec "pulp-ephemeral" pulpcore-manager reset-admin-password --password password
Expand Down

0 comments on commit 3b2345c

Please sign in to comment.