Created
May 26, 2021 15:52
-
-
Save calevans/054be53905f96dd2299df92c7b005aa3 to your computer and use it in GitHub Desktop.
Lando macros I use
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lando aliases and functions | |
# Author: Cal Evans | |
# Copyright 2021 All Rigths Reserved | |
# License MIT | |
# | |
# db | |
# | |
# Show what Lando (docker ) DB services are running and what port they are | |
# running on | |
# | |
function db() { | |
RUNNING=$(docker ps --format "table {{.Names}}__{{.Ports}}\n" | grep 3306) | |
echo | |
echo "Lando databases running" | |
echo "Instance Name : DB Port" | |
echo "----------------:--------" | |
for THISONE in $RUNNING | |
do | |
INSTANCE=$(echo $THISONE | awk '{print $1}' | awk -F '_' '{print $1}' ) | |
PORT=$(echo $THISONE | awk -F '__' '{print $2}' | awk -F ':' '{print $2}' | awk -F '->' '{print $1}') | |
printf "%-15s : %s\n" $INSTANCE $PORT | |
done | |
echo ""; | |
} | |
# | |
# running | |
# Show the running instances | |
# | |
alias running='docker ps --format "{{.Names}}"' | |
# | |
# log | |
# Start logging on the lando instance in the current dir. | |
# | |
alias log='lando logs -s appserver -f' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment