Re: [go-cd] Artifact fetch URL is broken

18 views
Skip to first unread message

Sriram Narayanan

unread,
Feb 8, 2022, 10:08:24 PM2/8/22
to go...@googlegroups.com
I’m on my phone and haven’t tried your snippet yet. Are you able to see the artifact foo.tar being generated and uploaded? Can you navigate to the artifacts tab and download this artifact Via your web browser?

— Sriram

On Wed, 9 Feb 2022 at 5:46 AM, Brian Kejser <br...@kaiserdigital.com> wrote:
I have two agents: one with the resource "build" and the other with the resource "integration".

Here's the pipeline

<pipeline name="demo-pipeline-master">
      <materials>
        <git url="{removed}" username="{removed}" encryptedPassword="{removed}" />
      </materials>
      <stage name="build-test-package">
        <jobs>
          <job name="build-test-package">
            <tasks>
              <exec command="bash">
                <arg>-c</arg>
                <arg>./test.sh</arg>
              </exec>
              <exec command="bash">
                <arg>-c</arg>
                <arg>./package.sh</arg>
              </exec>
            </tasks>
            <resources>
              <resource>build</resource>
            </resources>
            <artifacts>
              <artifact type="build" src="foo.tar" />
            </artifacts>
          </job>
        </jobs>
      </stage>
      <stage name="deploy-test">
        <jobs>
          <job name="deploy-test">
            <tasks>
              <fetchartifact artifactOrigin="gocd" srcdir="foo.tar" pipeline="demo-pipeline-master" stage="build-test-package" job="build-test-package">
                <runif status="passed" />
              </fetchartifact>
            </tasks>
            <resources>
              <resource>integration</resource>
            </resources>
          </job>
        </jobs>
      </stage>
    </pipeline>

When I run this, it fails because the following URL (in the log) returns a 404 error.

http://{hostname}:8153/go/files/demo-pipeline-master/5/build-test-package/latest/build-test-package/foo.tar





--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/0196defa-b9e9-4750-9720-b9b88ea6d404n%40googlegroups.com.

Aravind SV

unread,
Feb 9, 2022, 5:28:03 AM2/9/22
to go...@googlegroups.com

In this case, it looks like it should be srcfile not srcdir since foo.tar is a file.

Cheers,
Aravind

Reply all
Reply to author
Forward
0 new messages