Skip to content

Commit

Permalink
Prepare docker environment for beanstalkd
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Dec 21, 2024
1 parent ac8e320 commit 12c3284
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu, windows]
os: [ubuntu]

steps:
- if: matrix.os == 'windows'
Expand All @@ -19,6 +19,8 @@ jobs:
with:
submodules: true

- run: docker/start.sh

- uses: mlugg/setup-zig@v1
with:
version: master
Expand Down
6 changes: 6 additions & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/tempdir

standalone.conf

/startfedora.sh
7 changes: 7 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.5"

services:
beanstalk:
image: ${IMAGE}
ports:
- ${QPORT}:${QPORT}
36 changes: 36 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

export IMAGE=docker.io/rayyounghong/beanstalkd:latest
export QPORT=11300

if ! [ -f docker/docker-compose.yml ]; then
export DOCOMPOSE=./docker-compose.yml
else
export DOCOMPOSE=docker/docker-compose.yml
fi

docker compose -f $DOCOMPOSE up -d

echo Waiting for open port $QPORT

for (( ; ; ))
do
sudo netstat --tcp --listening --programs --numeric|grep -o $QPORT|wc -l >/tmp/openedports
OPENED=$(< /tmp/openedports)
if [ $OPENED -gt 0 ];
then
break
fi

echo -n .
sleep 1
done

echo 'ok'
echo ''

date
sudo netstat --tcp --listening --programs --numeric|grep $QPORT
echo ''


0 comments on commit 12c3284

Please sign in to comment.