zend-patterns / ZendServerSDK

Pure ZF2 CLI for zpk creation and webapi client.
BSD 3-Clause "New" or "Revised" License
22 stars 17 forks source link

This action requires the baseUrl parameter #52

Closed troelsh closed 9 years ago

troelsh commented 9 years ago

We have been trying to implement continuous integration with jenkins but there is a problem with deployment. We have located it down to that zs-client wont let us add the new application apparantly it does not the the baseUrl in the XML for the server request.

How: php /usr/local/bin/zs-client.phar installApp --zpk=application.zpk --zsurl='http://ZendServerIP:10081' --zskey='admin' --zssecret='XXXXX' --baseUri='http://OurVhost/' --userAppName='AppNameX' --userParams='APPLICATION_ENV=staging'

Result: 2015-01-07T16:26:55+00:00 ERR (3): This action requires the baseUrl parameter

applicationDeploy missingParameter # # The application has thrown an exception! ZendServerWebApi\Model\Exception\ApiException This action requires the baseUrl parameter As far as i can see you take the var $baseUri and put it into baseUrl we have tried the stable and the development release. ZendServer version 7.0.0 and 8.0 beta
slaff commented 9 years ago

Hi troelsh, I cannot reproduce the issue with the latest version of the tool (https://github.com/zendtech/ZendServerSDK/raw/master/bin/zs-client.phar). Can you try and execute the same command manually from the command line? If it works then please remove the single quotes and try again in Jenkins.

Regards, Slavey

troelsh commented 9 years ago

Hi Slavey,

This is the command manually executed from commandline on the jenkins server though. The zend server is an adjacent server ip connectivity and all is fine between the two servers it seems to upload the APK and then fails with the "missing baseUrl" message.

Other than in the command im my original post does baseUrl parameter need to be represented anywhere else?

This is my build.xml:

<?xml version="1.0"?>
<project name="<APPNAME>" basedir="." default="zpk">
    <target name="zpk">
        <exec command="php /usr/local/bin/zs-client.phar packZpk --folder='${project.basedir}'
--destination='${project.basedir}' --name='application.zpk'" checkreturn="true"/>
    </target>
    <target name="deploy" depends="zpk">
        <exec command="php /usr/local/bin/zs-client.phar installApp --zpk='${project.basedir}/application.
zpk' --zsurl='${host}' --zskey='${key}' --zssecret='${secret}' --baseUri='${base}' --userAppName='${app}'
--userParams='${params}'" checkreturn="true"/>
    </target>
</project>

And this is what i execute in commandline

php /usr/local/bin/zs-client.phar installApp --zpk=application.zpk --zsurl='http://10.x.x.x:10081' --zskey='admin' --zssecret='<SECRETKEY>' --baseUri='http://newdevserv1.XYZ.dk/' --userAppName='<CUSTOMER-APPNAME>' --userParams='APPLICATION_ENV=staging'

Jenkins config:

-Dhost=http://10.x.x.x:10081 -Dkey="admin" -Dsecret="<SECRETKEY>" -Dbase="http://newdevserv1.XYZ.dk/" -Dparams=”APPLICATION_ENV=staging” -Dapp="<CUSTOMER-APPNAME>"
troelsh commented 9 years ago

Okay so i had success now..

1 thing to remember is that if you try to do the commands in the jenkins workspace remember to cleanup. I had 3-4 zpk's of 100megs and i kept adding as i tested along and ended up with a huge zpk.

That was not the problem. The problem is that if you just copy from the pdf guide/patern the plings might turn up the wrong way and so my build.xml was not correct.

Had my first successfull build now and this is the build.xml that works.

<?xml version="1.0"?>
<project name="APPNAME" basedir="." default="zpk">  
    <target name="zpk">
        <exec command="php /usr/local/bin/zs-client.phar packZpk --folder='${project.basedir}' --destination='${project.basedir}' --name='application.zpk'" checkreturn="true"/>
    </target>
    <target name="deploy" depends="zpk">
        <exec command="php /usr/local/bin/zs-client.phar installApp --zpk='${project.basedir}/application.zpk' --zsurl='${host}' --zskey='${key}' --zssecret='${secret}' --baseUri='${base}' --userAppName='${app}' --userParams='${params}'" checkreturn="true"/>
    </target>
</project>
slaff commented 9 years ago

Ok, I will close the issue for now. If you think that it needs to be opened again feel free to add a comment to this ticket.