Page MenuHomeDevCentral

D1670.id4255.diff
No OneTemporary

D1670.id4255.diff

diff --git a/roles/paas-docker/wrappers/files/mysql.sh b/roles/paas-docker/wrappers/files/mysql.sh
new file mode 100755
--- /dev/null
+++ b/roles/paas-docker/wrappers/files/mysql.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# PaaS Docker
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2015-04-21
+# License: Trivial work, not eligible to copyright
+# Source file: roles/paas-docker/wrappers/files/mysql.sh
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+if [ "$#" -eq 0 ]; then
+ echo "Usage: $0 <container name>" 1>&2;
+ exit 1
+fi
+
+# -------------------------------------------------------------
+# Determine and validate MySQL container
+#
+# Validation code by Erik Kristensen <erik@erikkristensen.com>
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+CONTAINER=$1
+shift
+
+RUNNING=$(docker inspect --format="{{ .State.Running }}" "$CONTAINER" 2> /dev/null)
+
+if [ $? -eq 1 ]; then
+ echo "$0: $CONTAINER does not exist."
+ exit 3
+fi
+
+if [ "$RUNNING" = "false" ]; then
+ echo "$0: $CONTAINER is not running."
+ exit 2
+fi
+
+# -------------------------------------------------------------
+# Run container
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker run -it --rm \
+ --link "$CONTAINER:mysql" \
+ nasqueron/mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
diff --git a/roles/paas-docker/wrappers/init.sls b/roles/paas-docker/wrappers/init.sls
--- a/roles/paas-docker/wrappers/init.sls
+++ b/roles/paas-docker/wrappers/init.sls
@@ -12,7 +12,7 @@
# Wrapper binaries
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-{% for command in ['certbot', 'phpbb'] %}
+{% for command in ['certbot', 'phpbb', 'mysql'] %}
{{ dirs.bin }}/{{ command }}:
file.managed:
- source: salt://roles/paas-docker/wrappers/files/{{ command }}.sh

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 14:36 (20 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2308014
Default Alt Text
D1670.id4255.diff (2 KB)

Event Timeline