Hi Chad,

I scrapped both approaches since I couldnt get it to work.  We ended up 
leveraging the pluggable SCM along with the the Kubernetes secrets plugging 
and it all started to work.  Frustrating but overall happy this worked
Thanks for the feedback.

Kris
-
On Thursday, February 24, 2022 at 8:19:09 AM UTC-5 Chad Wilson wrote:

> Hiya
>
> For pipeline 1 in particular, did you set up/mount the `.git-credentials` 
> in the kubernetes elastic agent profile (its podspec in particular) and 
> test on an agent?
>
> If the pipeline triggers and shows the "changes" in the dropdown, your 
> GoCD *Server* can clone repos to detect changes and trigger builds, and 
> is probably fine. If it starts but the issue is in the log for the build, 
> then the problem is likely on the *agent*.
>
> But if the GoCD Server code isn't configured with the username/password, 
> it can't distribute them to the agents that need them. So you'd need to 
> configure the elastic agents somehow to model whatever server configuration 
> you've done, e.g by mounting part of a ConfigMap or running some pre-start 
> script somehow.
>
> This is why most folks that want to use username/pass will configure it 
> via GoCD server, to avoid manual agent configuration and hacking.
>
> I'm not sure what is wrong with "pipeline 2" (are you sure you configured 
> username and password inside GoCD correctly with something GitHub supports, 
> such as a personal access token linked to an account with read access to 
> the relevant repo?). I've also never personally tried to use GoCD with a 
> Git credential helper or OAuth2, so I don't know the details of how it 
> works.
>
> -Chad
>
> On Thu, Feb 24, 2022 at 11:14 AM Sifu Tian <[email protected]> wrote:
>
>> Ive been trying all day with no luck
>> I have 2 pipelines,  and no matter what scenario I choose, they both fail 
>> the initial cloning of my repository.  This is leveraging the kubernetes 
>> plugin for elastic agents.
>>
>>
>> pipeline 1:
>> Materials is set to:
>> https://github.com/org/repo.git
>> branch master
>> username and password blank because I am leveraging .git-credentials file 
>> on go-server which has valid access token with basic oauth 
>> https://XXXXXXTokenXXXXXXX <https://xxxxxxxxxxxxxxxxxx/>:
>> [email protected]
>>
>> I can perform a git clone on the go-server uder the go user with no 
>> problem so I know the connections works.
>> Error running pipeline :  *Cloning into '/go/pipelines/Common_Build'...*
>> *STDERR: fatal: could not read Username for 'https://github.com 
>> <https://github.com>': No such device or addressFailed to run git clone 
>> command*
>>
>> pipeline 2:
>> Materials is set to:
>> https://github.com/org/repo.git
>> branch master
>> Username and password are used and have full access to repo
>>
>> I can perform a git clone on the go-server uder the go user with no 
>> problem so I know the connections works.
>>
>> *Error running pipeline:*
>> *Cloning into '/go/pipelines/Common_Build'...STDERR: remote: Repository 
>> not found.STDERR: fatal: Authentication failed for 
>> 'https://github.com/org/repo.git/ <https://github.com/org/repo.git/>'Failed 
>> to run git clone command*
>>
>> Im really stuck no matter what I do.
>>
>> -- 
>> 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/64c0c7fc-04d0-4a4e-ad4f-f848730acbb5n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/go-cd/64c0c7fc-04d0-4a4e-ad4f-f848730acbb5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/323f0223-2431-465e-b45c-a6c1d96b337cn%40googlegroups.com.

Reply via email to