Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3770783
D2252.id5656.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2252.id5656.diff
View Options
diff --git a/contrib/arc b/contrib/arc
--- a/contrib/arc
+++ b/contrib/arc
@@ -1,21 +1,46 @@
#!/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
+ # If a stdin entry is available
+ # launch the container in the
+ # interactive mode
FLAGS=-it
fi
+# Logs are default disabled
PRINT_LOG=0
+
if [ "$1" = "shell" ]; then
+ # Launch commands
+ # in the container bash shell
shift
COMMAND=bash
else
+ # Launch arc
mkdir -p ~/.arc
COMMAND=arc
if [ "$1" = "call-conduit" ]; then
+ # Enable log printing
PRINT_LOG=1
- INSTANCE=`openssl rand -hex 21`
+ # Set a random name for the container
+ INSTANCE="arc-"`openssl rand -hex 21`
FLAGS="-i -a=stdin --name=$INSTANCE"
fi
fi
@@ -26,6 +51,10 @@
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 21:26 (21 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260753
Default Alt Text
D2252.id5656.diff (1 KB)
Attached To
Mode
D2252: Sync arc wrapper code with Nasqueron one
Attached
Detach File
Event Timeline
Log In to Comment