Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #25 from davidlmorton/tox-scripts
Browse files Browse the repository at this point in the history
Added scripts useful in tox.ini files
  • Loading branch information
mkiwala committed Apr 15, 2015
2 parents 75a387e + 7de151a commit 236c14f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/teardown_devserver
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash

PID=$(cat $1 2>/dev/null)

test -z $PID && echo "No devserver found to be running." && exit 0

echo -n "Killing devserver with PID: $PID "

kill $PID

while ps -p $PID >/dev/null; do
echo -n "."
sleep 1
done

echo
13 changes: 13 additions & 0 deletions scripts/wait_for_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/bash

WAIT_HOST=$(eval echo \${$1})
WAIT_PORT=$(eval echo \${$2})

echo -n "Waiting for service at $WAIT_HOST:$WAIT_PORT"

until echo dummy-value 2>/dev/null | nc $WAIT_HOST $WAIT_PORT >/dev/null 2>&1; do
echo -n "."
sleep 1
done

echo
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ summary = Common code for Ptero services
[files]
packages =
ptero_common
scripts =
scripts/teardown_devserver
scripts/wait_for_service

[global]
setup-hooks =
pbr.hooks.setup_hook


[entry_points]
console_scripts =
devserver = ptero_common.devserver:main

0 comments on commit 236c14f

Please sign in to comment.