How to deploy a Zend Application to Zend Server via Ant / Command Line

344 views Asked by At

I have been working to automate my deployment of my Zend Framework 2 project to my Zend Server.

The Zend Sever is running on an AWS Instance. We're running Atlassian Bamboo OnDemand using Elastic Instances.

zdpack ZPK

I have been using zdpack to create a .zpk, and I can manually deploy that to the server. So my assumption is that the package is correct.

zs-client

As per Zend's docs (http://www.zend.com/topics/Continuous-Delivery-of-PHP-Applications.pdf) and Matthew Weier O'phinney's blog (https://mwop.net/blog/2014-09-16-zend-server-deployment-part-7.html) I've been trying to use zs-client to manage the deployment.

I have tried installApp and applicationDeploy from the command line. I've had other developers on the team try separately in case I missed something. We've reviewed our parameters several times over. And all I was getting was "Reason for failure: Invalid arguments or no arguments provided"

This is my current ANT target:

<target name="qa-deploy" depends="qa-package">
    <exec executable="zs-client" failonerror="true">
        <arg value="installApp" />
        <arg value="--zpk='${basedir}/zpk/deploy.zpk'" />
        <arg value="--zsurl='${zs.host}'" />
        <arg value="--zskey='${zs.key}'" />
        <arg value="--zssecret='${zs.secret}'" />
        <arg value="--baseUri='${zs.base}'" />
        <arg value="--userAppName='${zs.app}'" />
        <arg value="--userParams='${zs.params}'" />
    </exec>
</target>

And what I get in my build log: qa-deploy:

20-Nov-2014 08:31:18         [exec] ======================================================================
20-Nov-2014 08:31:18         [exec]    The application has thrown an exception!
20-Nov-2014 08:31:18         [exec] ======================================================================
20-Nov-2014 08:31:18         [exec]  Zend\Http\Client\Adapter\Exception\RuntimeException
20-Nov-2014 08:31:18         [exec]  Unable to connect to :80 . Error #0: stream_socket_client(): unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known)

I have checked, the Zend Server is open for connections on 80, 443, 10081, 10082.


When running from the command line I get similar results. Does anyone know of any additional documentation available for the zs-client or know of an alternative? Is there something I'm missing here?

1

There are 1 answers

1
Sebastian Jerzy Wilczyński On

Is your ${zs.host} on port 80? If your Zend Server GUI is not specifically set to work on port 80 its default port is 10081, try this for your ${zs.host} (ie http://my.zendserver.com:10081)