Page MenuHomeDevCentral

run-test-new-container.sh

Authored By
dereckson
Nov 11 2015, 14:10
Size
1 KB
Referenced Files
None
Subscribers
None

run-test-new-container.sh

#!/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

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10892
Default Alt Text
run-test-new-container.sh (1 KB)

Event Timeline