Skip to content

Instantly share code, notes, and snippets.

@jom
Created July 26, 2018 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jom/62816b68c1aa3cc56e0b93bf2c249c15 to your computer and use it in GitHub Desktop.
Save jom/62816b68c1aa3cc56e0b93bf2c249c15 to your computer and use it in GitHub Desktop.
Sequel Pro with Docker Compose
#!/bin/bash
MYSQL_IP="127.0.0.1"
PORT=$(docker-compose port mysql 3306)
DINGHY_IP=$(dinghy ip)
PORT=${PORT/0.0.0.0:/}
FILE="/tmp/connection.spf"
cat > $FILE <<- EOM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ContentFilters</key>
<dict/>
<key>auto_connect</key>
<true/>
<key>data</key>
<dict>
<key>connection</key>
<dict>
<key>database</key>
<string>wordpress</string>
<key>host</key>
<string>$MYSQL_IP</string>
<key>kcid</key>
<string>5828310719528960874</string>
<key>name</key>
<string>docker</string>
<key>password</key>
<string>password</string>
<key>port</key>
<integer>$PORT</integer>
<key>rdbms_type</key>
<string>mysql</string>
<key>ssh_host</key>
<string>$DINGHY_IP</string>
<key>ssh_keyLocation</key>
<string></string>
<key>ssh_keyLocationEnabled</key>
<integer>0</integer>
<key>ssh_password</key>
<string>tcuser</string>
<key>ssh_user</key>
<string>docker</string>
<key>sslCACertFileLocation</key>
<string></string>
<key>sslCACertFileLocationEnabled</key>
<integer>0</integer>
<key>sslCertificateFileLocation</key>
<string></string>
<key>sslCertificateFileLocationEnabled</key>
<integer>0</integer>
<key>sslKeyFileLocation</key>
<string></string>
<key>sslKeyFileLocationEnabled</key>
<integer>0</integer>
<key>type</key>
<string>SPSSHTunnelConnection</string>
<key>useSSL</key>
<integer>0</integer>
<key>user</key>
<string>root</string>
</dict>
</dict>
<key>encrypted</key>
<false/>
<key>format</key>
<string>connection</string>
<key>queryFavorites</key>
<array/>
<key>queryHistory</key>
<array/>
<key>rdbms_type</key>
<string>mysql</string>
<key>rdbms_version</key>
<string>5.7.22</string>
<key>version</key>
<integer>1</integer>
</dict>
</plist>
EOM
open $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment