Skip to content

Commit

Permalink
Add runner-init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Feb 14, 2024
1 parent 7be8c8e commit 02fe257
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/bin/runner-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -ex

NAME=$1

if [ "$NAME" == "" ]
then
echo "Usage: runner-init.sh <name>"
exit 1
fi

if [ "$IMAGE" == "" ]
then
IMAGE=idm-console-framework-runner
fi

docker run \
--name=${NAME} \
--hostname=${HOSTNAME} \
--detach \
--privileged \
--tmpfs /tmp \
--tmpfs /run \
-v ${GITHUB_WORKSPACE}:${SHARED} \
-i \
${IMAGE}

# Pause 5 seconds to let the container start up.
# The container uses /usr/sbin/init as its entrypoint which requires few seconds
# to startup. This avoids the following error:
# [Errno 2] No such file or directory: '/var/cache/dnf/metadata_lock.pid'
sleep 5

0 comments on commit 02fe257

Please sign in to comment.