Created
April 2, 2021 14:56
-
-
Save mattbloomfield/7d8f61e4f40f4e9d1ec065d2a8a9bc14 to your computer and use it in GitHub Desktop.
Easy way to SSH into a psh env
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
#!/bin/sh | |
BLUE=\\x1B[34m | |
YELLOW=\\x1B[33m | |
GREEN=\\x1B[32m | |
RED=\\x1B[31m | |
RESET=\\x1b[0m | |
## Easy way to SSH into a psh env | |
## Usage: fin ssh <environment> | |
REMOTE_ENV=$1 | |
if [ -z "$REMOTE_ENV" ] | |
then | |
echo "${BLUE}Please choose an environment to pull from${RESET}" | |
select REMOTE_ENV in "master" "staging" "production"; do | |
case $REMOTE_ENV in | |
"master") | |
break | |
;; | |
"staging") | |
break | |
;; | |
"production") | |
break | |
;; | |
*) | |
echo "Invalid option $REPLY";; | |
esac | |
done | |
fi | |
SSH_URL=$(fin platform ssh --pipe --project $HOSTING_SITE -e $REMOTE_ENV) | |
echo "SSH URL: ${SSH_URL}" | |
ssh ${SSH_URL} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment