Automate Build and Deploy

You can also automate the revision, building, and deployment of a policy. You can configure for automating in build.properties file.

To automate revision and deployment of customized policies:
  1. Open the build.properties file in a text editor.
  2. Set the following values.
    policyName={policy name}
    jarPrefix= {prefix to the policy jar} 
    policy-sdk={location of the policy sdk}
    
    autoRevision=false
    autoDeploy=false
    
    ### if either 'autoRevision' or 'autoDeploy"
    ### properties are set to 'true', then the
    ### properties below must be set as well
    
    mgmtServerHost=http:// {host name}
    mgmtServerPort= {port number}
    mgmtServerUser= {admin user name}
    mgmtServerPass= {password}
    For example,
    policyName=mypolicy
    jarPrefix=apiplatform.policies
    policy-sdk=/home/apics/labs/policy-develop/policy-sdk
    
    autoRevision=true
    autoDeploy=true
    
    ### if either 'autoRevision' or 'autoDeploy"
    ### properties are set to 'true', then the
    ### properties below must be set as well
    
    mgmtServerHost= http://apics.xyz.com
    mgmtServerPort= 7006
    mgmtServerUser= admin
    mgmtServerPass= pass123
  3. Save the changes and close the text editor.
  4. Execute the ant script build.xml from eclipse.
  5. Once the script finishes, you can find the new file in the root folder and it is also automatically deployed to the management tier.
  6. Go to the API implementation tab and check for the policy under the Available Policies, Others category.

    If the API Management Tier is open when policy is deployed, the new customized policy does not appear. Do a force browser refresh - Ctrl + F5 and APIP Management Tier reloads the policies.