Last active
March 16, 2017 21:53
-
-
Save Freyert/032c5bf7341d9c229a0b9804a95525f7 to your computer and use it in GitHub Desktop.
Cloud Foundry SCP entire NodeJS App
This file contains hidden or 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/bash | |
#https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html#ssh-command | |
APP_NAME="my_app" | |
GUID=$(cf app $APP_NAME --guid) | |
INFO=$(cf curl /v2/info) | |
export CF_SSH_ENDPOINT=$(printf $INFO | jq '.app_ssh_endpoint' | cut -d ':' -f1 | tail -c +2) | |
export CF_SSH_PORT=$(printf $INFO | jq '.app_ssh_endpoint' | cut -d ':' -f2 | tr -d \") | |
export CF_SSH_FINGERPRINT=$(printf $INFO | jq '.app_ssh_host_key_fingerprint' | cut -d ':' -f1 | tail -c +2) | |
export CF_SSH_USER="cf:$GUID/0" | |
#AFTER sourcing this file | |
#cf ssh-code | pbcopy | |
#rsync --progress -avhe "ssh -p $CF_SSH_PORT -o User=$CF_SSH_USER" $CF_SSH_ENDPOINT:/home/vcap/app ./ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to swap to something where we can exclude directories.