Question

I'm trying to customise the deploy scripts to allow me to deploy each of my four API proxies from the command line. It looks very similar to the one provided in the samples on Github:

#!/bin/bash

if [[ $# -eq 0 ]] ; then
    echo 'Must provide proxy name.'
    exit 0
fi

dirname=$1
proxyname="teamname-"$dirname

source ./setup/setenv.sh

echo "Enter your password for user $username in the Apigee Enterprise organization $org, followed by [ENTER]:"

read -s password

echo Deploying $proxyname to $env on $url using $username and $org

./tools/deploy.py -n $proxyname -u $username:$password -o $org -h $url -e $env -p / -d ./$dirname

echo "If 'State: deployed', then your API Proxy is ready to be invoked."
echo "Run '$ sh invoke.sh'"
echo "If you get errors, make sure you have set the proper account settings in /setup/setenv.sh"

However when I run it, I get the following response:

Deploying teamname-gameassets to int on https://api.enterprise.apigee.com using my-email-address and org-name
Writing ./gameassets/teamname-gameassets.xml to ./teamname-gameassets.xml
Writing ./gameassets/policies/Add-CORS.xml to policies/Add-CORS.xml
Writing ./gameassets/proxies/default.xml to proxies/default.xml
Writing ./gameassets/targets/development.xml to targets/development.xml
Writing ./gameassets/targets/production.xml to targets/production.xml
Import failed to /v1/organizations/org-name/apis?action=import&name=teamname-gameassets with status 500:
{
  "code" : "messaging.config.beans.ImportFailed",
  "message" : "Failed to import the bundle : java.lang.NullPointerException",
  "contexts" : [ ],
  "cause" : {
    "contexts" : [ ]
  }
}

How should I go about debugging when I receive errors during the deploy process? Is there some sort of console I can view once logged in to Apigee?

Was it helpful?

Solution

I'm not sure how your proxy ended up this way, but it looks like the top-level directory is named "gameassets." It should be named "apiproxy". If you rename this directory you should see a successful deployment.

Also, before you customize too much, please try out "apigeetool," which is a more flexible command-line tool for deploying proxies:

https://github.com/apigee/api-platform-tools

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top