Skip to content

Instantly share code, notes, and snippets.

@Freyert
Last active March 16, 2017 21:53
Show Gist options
  • Save Freyert/032c5bf7341d9c229a0b9804a95525f7 to your computer and use it in GitHub Desktop.
Save Freyert/032c5bf7341d9c229a0b9804a95525f7 to your computer and use it in GitHub Desktop.
Cloud Foundry SCP entire NodeJS App
#!/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 ./
@Freyert
Copy link
Author

Freyert commented Mar 16, 2017

Need to swap to something where we can exclude directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment