0
我已經搜索了用於java web項目部署的gcloud doc,但是在結果中只有maven項目doc。已在Google雲端控制檯中創建的項目和Google sdk也已安裝。如何在gcloud vm實例上使用ant部署java web項目
我已經搜索了用於java web項目部署的gcloud doc,但是在結果中只有maven項目doc。已在Google雲端控制檯中創建的項目和Google sdk也已安裝。如何在gcloud vm實例上使用ant部署java web項目
一種方法是簡單地連接到谷歌雲機與螞蟻sshexec & SCP任務,以及沉積壓縮包和提取物,例如可能是..:
<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實例化組。
請檢查這個[URL](http://stackoverflow.com/help)它將有助於提高您的內容質量 –