Skip to content
Snippets Groups Projects

WIP: Set DB port if env var set

Open Francisco Borges Aurindo Barros requested to merge dbod-compatible into add-authz-endpoint
1 unresolved thread

Part of #26 (closed)

Required as currently we use the default expected port from wordpress (3306) , which for DBoD will be variable.

Replaced by !48 (merged)

Edited by Francisco Borges Aurindo Barros

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
73 73
74 74 echo "--> Creating Wordpress configuration files ..."
75 75 # --skip-check avoids the need for mysql binary and mysql lcoal install
76 wp config create --dbname="$MYSQL_DATABASE" --dbhost="$MYSQL_HOST" --dbprefix="$MYSQL_TABLE_PREFIX" --dbuser="$MYSQL_USER" --dbpass="$MYSQL_PASSWORD" --skip-check
76 if [ -v $MYSQL_PORT ]; then
77 wp config create --dbname="$MYSQL_DATABASE" --dbhost="$MYSQL_HOST:$MYSQL_PORT" --dbprefix="$MYSQL_TABLE_PREFIX" --dbuser="$MYSQL_USER" --dbpass="$MYSQL_PASSWORD" --skip-check
78 else
79 wp config create --dbname="$MYSQL_DATABASE" --dbhost="$MYSQL_HOST" --dbprefix="$MYSQL_TABLE_PREFIX" --dbuser="$MYSQL_USER" --dbpass="$MYSQL_PASSWORD" --skip-check
80 fi
  • Comment on lines +76 to +80

    Nitpick: Just a suggestion on this could be the change bellow, so we do not repeat the command twice and make it a bit easier to read.

    if [ -v "$MYSQL_PORT" ]; then

    DBHOST="$MYSQL_HOST:$MYSQL_PORT" 

    else

    DBHOST="$MYSQL_HOST" 

    fi

    wp config create --dbhost**="$DBHOST" ...(rest of command)

    Edited by Georgios Tsoulos
  • Please register or sign in to reply
  • Carina Antunes added 4 commits

    added 4 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading