如何使用AntScripts自动将工件上传到GCP?

时间:2019-09-21 13:31:37

标签: ant google-cloud-storage

我在本地系统上自动化了bar文件的构建,创建和部署过程。现在,我想使用AntScripts将生成的工件存储到Google Cloud Storage(存储桶)中。

我的疑问是,我们可以编写用于将工件上传到护目镜存储桶的Ant脚本吗?如果可以,我们需要添加到ANT库安装路径中的依赖JAR列表是什么?

那么,任何人都可以对此提出建议或任何参考链接吗?

1 个答案:

答案 0 :(得分:1)

是的,我们可以编写用于将工件上传到护目镜存储桶的Ant脚本

下面是示例代码段

<target name="uploadArtifact">
  <echo message=" uploading artifacts />
    <exec executable="/var/lib/jenkins/google-cloud-sdk/bin/gsutil">
      <arg value="cp"/>
      <arg value="source-path"/>
      <arg value="destination-path"/>
   </exec>   
</target>