2016-04-29 34 views
0

Java Webプロジェクトのデプロイメントについてgcloud docを検索しましたが、結果としてmavenプロジェクトのdocしか取得できませんでした。プロジェクトは既にGoogleのクラウドコンソールとGoogleのSDDKもインストールされて作成されます。gcloud VMインスタンスでantを使用してJava Webプロジェクトをデプロイする方法

+0

この[URL](http://stackoverflow.com/help)を確認してください。コンテンツの品質を上げることが有効です –

答えて

0

一つの方法は、単にANTでsshexec & SCPタスクでGoogleクラウド・マシンに接続し、tarファイルと抽出物を堆積することで、例があるかもしれない..:上記

<target name="deploy-staging" description="Deploy to staging"> 
     <input message="Staging Passphrase:" addproperty="my.password"> 
      <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> 
     </input> 
     <!-- Create the new release folder on host--> 
     <sshexec trust="true" 
       host="hosthere" 
       username="username" 
       keyfile="${user.home}/.ssh/keyfile" 
       passphrase="${my.password}" 
       command="mkdir /var/www/releases/${git.revision}" /> 

     <!-- Push the application tarball to the server--> 
     <scp trust="true" 
      file="${basedir}/build/${git.revision}.tar.gz" 
      todir="[email protected]${hosthere}:/var/www/releases/${git.revision}" 
      keyfile="${user.home}/.ssh/keyfile" 
      passphrase="${my.password}"/> 

     <!-- Extract the tarball on the server--> 
     <sshexec trust="true" 
       host="${hosthere}" 
       username="username" 
       keyfile="${user.home}/.ssh/keyfile" 
       passphrase="${my.password}" 
       command="cd /var/www/releases/${git.revision}; tar -xvzf ${git.revision}.tar.gz" /> 
     <sshexec trust="true" 
       host="${hosthere}" 
       username="username" 
       keyfile="${user.home}/.ssh/keyfile" 
       passphrase="${my.password}" 
       command="rm -rf /var/www/current" /> 

     <sshexec trust="true" 
       host="${hosthere}" 
       username="username" 
       keyfile="${user.home}/.ssh/keyfile" 
       passphrase="${my.password}" 
       command="ln -s /var/www/releases/${git.revision} -T /var/www/current" /> 
    </target> 

されませんgcloudインスタンス化されたグループを処理するためのよりよい方法を探している間にこれを使用して終了しました。

関連する問題