Page MenuHomeDevCentral

D351.diff
No OneTemporary

D351.diff

diff --git a/roles/phabricator/containers/Makefile b/roles/phabricator/containers/Makefile
new file mode 100644
--- /dev/null
+++ b/roles/phabricator/containers/Makefile
@@ -0,0 +1,5 @@
+INSTALL=install
+PREFIX=/usr/local
+
+install:
+ ${INSTALL} files/run-* ${PREFIX}/bin/
diff --git a/roles/phabricator/containers/files/run-aphlict b/roles/phabricator/containers/files/run-aphlict
new file mode 100755
--- /dev/null
+++ b/roles/phabricator/containers/files/run-aphlict
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Phabricator — Aphlict notifications server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Author: Sébastien Santoro aka Dereckson
+# Project: Nasqueron
+# Created: 2016-03-28
+# Description: Node application to get real time notifications
+# through websockets for Phabricator instances.
+# License: Trivial work, not eligible to copyright
+# Image: nasqueron/aphlict
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Container parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+INSTANCE_NAME=aphlict
+
+# -------------------------------------------------------------
+# Container launch
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker run -dt --name $INSTANCE_NAME -p 22280:22280 -p 22281:22281 nasqueron/aphlict
diff --git a/roles/phabricator/containers/files/run-devcentral b/roles/phabricator/containers/files/run-devcentral
new file mode 100755
--- /dev/null
+++ b/roles/phabricator/containers/files/run-devcentral
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Phabricator — Nasqueron instance
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Author: Sébastien Santoro aka Dereckson
+# Project: Nasqueron
+# Created: 2015-04-22
+# Description: Phabricator instance for Nasqueron
+# License: Trivial work, not eligible to copyright
+# Image: nasqueron/phabricator
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Container parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+INSTANCE_NAME=devcentral
+PORT=31080
+DOMAIN=$INSTANCE_NAME.nasqueron.org
+DATA_DIRECTORY=/data/$INSTANCE_NAME
+MYSQL_INSTANCE=acquisitariat
+
+# -------------------------------------------------------------
+# Phabricator parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+PHABRICATOR_URL=http://$DOMAIN
+PHABRICATOR_TITLE="Nasqueron DevCentral"
+PHABRICATOR_ALT_FILE_DOMAIN="https://phabricator-files-for-devcentral-nasqueron.spacetechnology.net"
+
+# -------------------------------------------------------------
+# Deployment of our Phabricator code parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+REPO_LOGIN=git
+REPO_HOST=bitbucket.org
+PHABRICATOR_PROD_REPO="ssh://git@bitbucket.org/nasqueron/devcentral-phabricator"
+PHABRICATOR_PROD_BRANCH=production
+
+# -------------------------------------------------------------
+# Ensure container isn't already 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
+
+# -------------------------------------------------------------
+# Container launch
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker run -t -d \
+ --link $MYSQL_INSTANCE:mysql \
+ -v $DATA_DIRECTORY/repo:/var/repo \
+ -v $DATA_DIRECTORY/conf:/opt/phabricator/conf \
+ -p $PORT:80 \
+ -e PHABRICATOR_URL=$PHABRICATOR_URL \
+ -e PHABRICATOR_TITLE="$PHABRICATOR_TITLE" \
+ -e PHABRICATOR_ALT_FILE_DOMAIN="$PHABRICATOR_ALT_FILE_DOMAIN" \
+ -e PHABRICATOR_PROD_REPO=$PHABRICATOR_PROD_REPO \
+ -e PHABRICATOR_PROD_BRANCH=$PHABRICATOR_PROD_BRANCH \
+ -e PHABRICATOR_USE_MAILGUN=1 \
+ -e PHABRICATOR_DOMAIN=$DOMAIN \
+ -e PHABRICATOR_BOT=xessife \
+ --name $INSTANCE_NAME nasqueron/phabricator
+
+# -------------------------------------------------------------
+# DevCentral specific branch deployment
+#
+# Deploys our version
+# As we change static resources, restart php-fpm is a good idea:
+# if someone asks the page while we were pulling our version,
+# the old celerity map would be kept by APCu.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker exec $INSTANCE_NAME sh -c 'mkdir -p /root/.ssh && \
+ cp /opt/phabricator/conf/deploy-keys/* /root/.ssh'
+docker exec $INSTANCE_NAME ssh -o StrictHostKeyChecking=no ${REPO_LOGIN}@${REPO_HOST}
+docker exec $INSTANCE_NAME sh -c 'cd /opt/phabricator && \
+ git remote add private "$PHABRICATOR_PROD_REPO" && \
+ git fetch --all && \
+ git checkout $PHABRICATOR_PROD_BRANCH && \
+ sv restart php-fpm && sv restart phd'
+
+echo "Deployment done at `date`."
+exit 0
diff --git a/roles/phabricator/containers/files/run-wolfphab b/roles/phabricator/containers/files/run-wolfphab
new file mode 100755
--- /dev/null
+++ b/roles/phabricator/containers/files/run-wolfphab
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Phabricator — Wolfplex instance
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Author: Sébastien Santoro aka Dereckson
+# Project: Nasqueron
+# Created: 2015-10-25
+# Description: Phabricator instance for Nasqueron
+# License: Trivial work, not eligible to copyright
+# Image: nasqueron/phabricator
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Container parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+INSTANCE_NAME=wolfphab
+PORT=35080
+DOMAIN=phabricator.wolfplex.be
+DATA_DIRECTORY=/data/$INSTANCE_NAME
+MYSQL_INSTANCE=acquisitariat
+MYSQL_NAMESPACE=wolfphab
+
+# -------------------------------------------------------------
+# Phabricator parameters
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+PHABRICATOR_URL=https://$DOMAIN
+PHABRICATOR_TITLE="Wolfplex Phabricator"
+PHABRICATOR_ALT_FILE_DOMAIN="https://phabricator-files-for-wolfplex.nasqueron.org"
+
+# -------------------------------------------------------------
+# Ensure container isn't already 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
+
+# -------------------------------------------------------------
+# Container launch
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker run -t -d \
+ --link $MYSQL_INSTANCE:mysql \
+ -v $DATA_DIRECTORY/repo:/var/repo \
+ -v $DATA_DIRECTORY/conf:/opt/phabricator/conf \
+ -p $PORT:80 \
+ -e PHABRICATOR_URL=$PHABRICATOR_URL \
+ -e PHABRICATOR_TITLE="$PHABRICATOR_TITLE" \
+ -e PHABRICATOR_ALT_FILE_DOMAIN="$PHABRICATOR_ALT_FILE_DOMAIN" \
+ -e PHABRICATOR_STORAGE_NAMESPACE="$MYSQL_NAMESPACE" \
+ --name $INSTANCE_NAME nasqueron/phabricator
+
+docker exec $INSTANCE_NAME sh -c 'cd /opt/phabricator && \
+ bin/config set mysql.host mysql && \
+ bin/config set mysql.pass $MYSQL_ENV_MYSQL_ROOT_PASSWORD && \
+ bin/config set storage.default-namespace $PHABRICATOR_STORAGE_NAMESPACE && \
+ bin/config set phabricator.base-uri $PHABRICATOR_URL && \
+ bin/config set security.alternate-file-domain "$PHABRICATOR_ALT_FILE_DOMAIN" && \
+ bin/config set mailgun.domain $DOMAIN && \
+ rm -f /etc/nginx/sites-enabled/default && \
+ chown -R app /var/repo'
+
+# Fixes bug phd doesn't run at the very first container launch
+docker exec $INSTANCE_NAME sv restart phd
+
+echo "Deployment done at `date`."
+exit 0

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 15:57 (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2312744
Default Alt Text
D351.diff (8 KB)

Event Timeline