Page MenuHomeDevCentral

D350.id826.diff
No OneTemporary

D350.id826.diff

diff --git a/roles/phabricator/arcanist/Makefile b/roles/phabricator/arcanist/Makefile
new file mode 100644
--- /dev/null
+++ b/roles/phabricator/arcanist/Makefile
@@ -0,0 +1,5 @@
+INSTALL=install
+PREFIX=/usr/local
+
+install:
+ ${INSTALL} files/arc ${PREFIX}/bin/
diff --git a/roles/phabricator/arcanist/files/arc b/roles/phabricator/arcanist/files/arc
new file mode 100755
--- /dev/null
+++ b/roles/phabricator/arcanist/files/arc
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Phabricator — Arcanist Docker container wrapper
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Author: Sébastien Santoro aka Dereckson
+# Project: Nasqueron
+# Created: 2016-01-01
+# Description: Wrapper to run Arcanist as a Docker container
+# License: Trivial work, not eligible to copyright
+# Image: nasqueron/arcanist
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Parse arguments
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ -t 0 ]; then
+ FLAGS=-it
+fi
+
+PRINT_LOG=0
+
+if [ "$1" = "shell" ]; then
+ shift
+ COMMAND=bash
+else
+ mkdir -p ~/.arc
+ COMMAND=arc
+
+ if [ "$1" = "call-conduit" ]; then
+ PRINT_LOG=1
+ INSTANCE=`openssl rand -hex 21`
+ FLAGS="-i -a=stdin --name=$INSTANCE"
+ fi
+fi
+
+if [ -d ~/.arc/ssh ]; then
+ VOLUME_SSH="-v $HOME/.arc/ssh:/root/.ssh"
+else
+ VOLUME_SSH=""
+fi
+
+# -------------------------------------------------------------
+# Run container
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ $PRINT_LOG -eq 0 ]; then
+ docker run $FLAGS --rm -v ~/.arc:/opt/config -v $PWD:/opt/workspace $VOLUME_SSH nasqueron/arcanist $COMMAND $*
+else
+ docker run $FLAGS -v ~/.arc:/opt/config -v $PWD:/opt/workspace $VOLUME_SSH nasqueron/arcanist $COMMAND $* > /dev/null
+ sleep 3
+ docker logs $INSTANCE
+ docker rm $INSTANCE >/dev/null
+fi

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:24 (19 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259994
Default Alt Text
D350.id826.diff (1 KB)

Event Timeline