Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3929758
D1518.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1518.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D1518: Provide wrapper to connect to phpBB SaaS MySQL server
Attached
Detach File
Event Timeline
Log In to Comment