Page MenuHomeDevCentral

D1518.diff
No OneTemporary

D1518.diff

diff --git a/roles/paas-docker/wrappers/files/phpbb.sh b/roles/paas-docker/wrappers/files/phpbb.sh
new file mode 100755
--- /dev/null
+++ b/roles/paas-docker/wrappers/files/phpbb.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# PaaS Docker
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-03-27
+# License: Trivial work, not eligible to copyright
+# Source file: roles/paas-docker/wrappers/files/phpbb.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>
+
+# -------------------------------------------------------------
+# Configuration required by Docker
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+MYSQL_CONTAINER=phpbb_db
+MYSQL_IMAGE=nasqueron/mysql
+
+# -------------------------------------------------------------
+# Helper methods
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+getcommandname() {
+ basename "$0"
+}
+
+usage() {
+ echo "Usage: $(getcommandname) <command>"
+ exit 1
+}
+
+unknown_command() {
+ echo "$(getcommandname): $COMMAND: unknown command"
+ usage
+}
+
+# -------------------------------------------------------------
+# Commands
+#
+# :: phpbb storage: connects to MySQL database
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+phpbb_storage() {
+ # shellcheck disable=SC2016
+ docker run -it --rm --link $MYSQL_CONTAINER:mysql $MYSQL_IMAGE \
+ sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
+}
+
+# -------------------------------------------------------------
+# Check arguments
+#
+# $1: wiki name (database name or alias)
+# $2: script to call
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ $# -lt 1 ]; then
+ usage
+fi
+
+COMMAND=$1
+shift 1
+
+# -------------------------------------------------------------
+# Run command
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [ "$COMMAND" = "storage" ]; then
+ phpbb_storage
+else
+ unknown_command
+fi
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'] %}
+{% for command in ['certbot', 'phpbb'] %}
{{ dirs.bin }}/{{ command }}:
file.managed:
- source: salt://roles/paas-docker/wrappers/files/{{ command }}.sh

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 10:43 (12 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2312313
Default Alt Text
D1518.diff (2 KB)

Event Timeline