gocd - upload artifact to google storage bucket

57 views
Skip to first unread message

Bojan Saric

unread,
Jun 24, 2020, 9:11:28 AM6/24/20
to go-cd
Hi, 
i am using gocd on GKE installed with Helm.

I was wondering how to copy artifact (in this case tgz file) to Google storage bucket on successful build?

I was trying to figure it out, but I unable to do so.

Thanks in advance

Ashwanth Kumar

unread,
Jun 24, 2020, 9:48:52 AM6/24/20
to go...@googlegroups.com
Looking at https://www.gocd.org/plugins.html, I don't think there is any Google Storage plugin at this point for GoCD. One way to upload an artifact is to have a task that can use the gsutil cp from a script or directly as a task.

Thanks,

--
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/fa5f6572-8a53-4269-bfe4-8af7b8223b21n%40googlegroups.com.


--

Ashwanth Kumar / ashwanthkumar.in

Bojan S.

unread,
Jun 24, 2020, 11:05:40 AM6/24/20
to go-cd
Thanks, I know about plugins, there is only S3 plugin available.

Problem using gsutil is that it requires GCE credentials of kind, either user or service account. 

I know how to do that for the source repo, like github etc.
I am not sure how to add service account to helm GoCD, yet I cannot find that anyone tried something like this. 
Looks like everyone is mostly using S3 service.

Kind regards,
Bojan

Ashwanth Kumar

unread,
Jun 25, 2020, 12:25:41 AM6/25/20
to go...@googlegroups.com
I've been using S3 for artifact storage (one of the authors of gocd-s3-artifacts suite of plugins) for a long time now, and we still have to handle the same issue. You need AWS Credentials in terms of AccessKey and SecretKey or IAM roles on the instances where the GoCD server and/or agent(s) are running. The S3 plugins ask the administrator of GoCD to set these configurations as part of the plugin installation. I don't have much experience in GKE, maybe others using GCP for running GoCD might be able to respond and help you with setting up the required credentials.

Thanks,

Bojan S.

unread,
Aug 12, 2020, 4:42:32 AM8/12/20
to go-cd
I've managed to solve this. I've added secret to gocd cluster and using config XML, it is connected to gocd-agent pod.
Image used for gocd-agent has gcloud installed.

Afterwards, there is pipeline that is dependent on built artifact and uses it to copy archive to bucket on same GCE project where kubernetes cluster is.

Service account is used by gcloud command to authenticate and afterwards, simple gsutil copy command just transfers archive to bucket.

If there are questions, please let me know.

Kind regards,
B
Reply all
Reply to author
Forward
0 new messages