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

On Thursday, June 25, 2020 at 6:25:41 AM UTC+2 [email protected] wrote:

> I've been using S3 for artifact storage (one of the authors of 
> gocd-s3-artifacts <https://github.com/indix/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,
>
> On Wed, Jun 24, 2020 at 8:35 PM Bojan S. <[email protected]> wrote:
>
>> 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
>> On Wednesday, June 24, 2020 at 3:48:52 PM UTC+2 [email protected] 
>> wrote:
>>
>>> 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 
>>> <https://cloud.google.com/storage/docs/gsutil/commands/cp> from a 
>>> script or directly as a task.
>>>
>>> Thanks,
>>>
>>> On Wed, Jun 24, 2020 at 6:41 PM Bojan Saric <[email protected]> wrote:
>>>
>>>> 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
>>>>
>>>> -- 
>>>> 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 [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/go-cd/fa5f6572-8a53-4269-bfe4-8af7b8223b21n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/go-cd/fa5f6572-8a53-4269-bfe4-8af7b8223b21n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>>
>>> Ashwanth Kumar / ashwanthkumar.in
>>>
>>> -- 
>> 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 [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/go-cd/9b1025b4-3aae-48cd-9b30-981f99652afan%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/go-cd/9b1025b4-3aae-48cd-9b30-981f99652afan%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
>
> Ashwanth Kumar / ashwanthkumar.in
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/598bd10b-0174-4d51-85b9-c67543b7716cn%40googlegroups.com.

Reply via email to