Skip to content

Push without resource matching (or routes, or really anything else)

Greg Cobb edited this page Mar 13, 2017 · 2 revisions

Mini Push

Resource matching can timeout and block app pushing (for example pushing apps with lots of files with a degraded blobstore). The following script will let you push an app without resource matching.

# Usage
# =========
#  1) cd to your app directory
#  2) ./mini-push.sh <space_name> <app_name> <api_url>
#  3) Wait a hot minute

set -ex

space_name=$1
app_name=$2
api_url=$3

space_guid=`cf space ${space_name} --guid`
cf curl /v2/apps -X POST -d "{\"name\":\"${app_name}\",\"space_guid\":\"${space_guid}\"}"
app_guid=`cf app ${app_name} --guid`
zip -r my-app.zip *
curl -X PUT ${api_url}/v2/apps/${app_guid}/bits -F application=@"my-app.zip" -F resources=[] -H "Authorization: `cf oauth-token | grep bearer`"
cf curl -X PUT /v2/apps/$app_guid -d '{"state":"STARTED"}'
Clone this wiki locally