Search code examples
antgoogle-cloud-storage

How to automate the Uploading Artifacts to GCP using AntScripts?


I automated the build, create and deployment process of bar files on my local system. Now I want to store generated Artifacts into Google Cloud Storage(buckets) using AntScripts.

Here my doubt is, Can we write Ant scripts for Uploading Artifacts to goggle storage buckets? if we can, what is the list of dependency JARs we need to add into ANT library installation path?

so, Can anyone give a suggestions on this or any reference links would be fine?


Solution

  • Yes, we can write Ant script for Uploading Artifacts to goggle storage buckets

    Below is the sample code snippet

    <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>