Page MenuHomeDevCentral
Paste P124

run-test-new-container.sh
ActivePublic

Authored by dereckson on Nov 11 2015, 14:10.
Tags
None
Referenced Files
F12238: run-test-new-container.sh
Mar 12 2016, 03:49
Subscribers
None
#!/bin/sh
INSTANCE_NAME=phabtest
DOMAIN=$INSTANCE_NAME.nasqueron.org
DATA_DIRECTORY=/tmp/$INSTANCE_NAME
MYSQL_INSTANCE_NAME=phabtest-mysql
PHABRICATOR_URL=http://$DOMAIN:8080
PHABRICATOR_TITLE="Demo"
# Checks container isn't running
docker-container-status $INSTANCE_NAME > /dev/null
if [ "$?" -lt 2 ]; then
echo "Container is already running."
echo "To force relaunch, try docker stop $INSTANCE_NAME ; docker rm $INSTANCE_NAME ; $0"
exit 1
fi
# Create MySQL container
docker-container-status $MYSQL_INSTANCE_NAME > /dev/null
if [ "$?" -lt 2 ]; then
echo "Warning: reusing existing MySQL container."
else
docker run -dt -e MYSQL_ROOT_PASSWORD=`openssl rand -hex 21` --name $MYSQL_INSTANCE_NAME nasqueron/mysql
fi
# Create Phabricator container
mkdir -p $DATA_DIRECTORY
docker run -t -d \
--link $MYSQL_INSTANCE_NAME:mysql \
-v $DATA_DIRECTORY/repo:/var/repo \
-v $DATA_DIRECTORY/conf:/opt/phabricator/conf \
-p 8080:80 \
-e PHABRICATOR_URL=$PHABRICATOR_URL \
-e PHABRICATOR_TITLE="$PHABRICATOR_TITLE" \
-e PHABRICATOR_DOMAIN=$DOMAIN \
--name $INSTANCE_NAME nasqueron/phabricator

Event Timeline

dereckson changed the title of this paste from untitled to run-test-new-container.sh.