Ah I am running Jenkins inside a pod and invoking oc from there. Thanks for
the tip.

Before I can run oc I'm having to set KUBECONFIG to some location I know I
can write to.

Otherwise I get this error when running any oc command:

error: KUBECONFIG is set to a file that cannot be created or modified:
/.kube/config
mkdir /.kube: permission denied

To install the client I simply downloaded the tar, unpacked and created a
sym link. Do I need any more setup or setting KUBECONFIG every time is the
way to go?

On 28 September 2016 at 22:51, Cesar Wong <[email protected]> wrote:

> You can always create a new role that only allows the actions that you
> need to kick off a new build (create on builds and builds/source,  read on
> buildconfigs).
>
> Also, if you're running oc inside a pod within OpenShift, oc will use the
> credentials of the service account used to run the pod. No need to
> explicitly log in.
>
> On Sep 28, 2016, at 1:40 AM, Lionel Orellana <[email protected]> wrote:
>
> Adding the edit cluster role seems to work.
>
> oadm policy add-cluster-role-to-user edit system:serviceaccount:jenkins:
> jenkins
>
> But is feels I'm giving it too much access. I tried with role
> system:build-controller but that wasn't enough.
>
> On 28 September 2016 at 14:00, Lionel Orellana <[email protected]> wrote:
>
>> Thanks. Invoking oc will do.
>>
>> I guess I have to oc login everytime?
>>
>> Somehow related question: can I have one service account with access to
>> start builds across all projects? I created a jenkins service account for
>> this purpose but I'm not sure how to give it access to all projects instead
>> of one by one.
>>
>>
>>
>>
>>
>> On 27 September 2016 at 22:48, Clayton Coleman <[email protected]>
>> wrote:
>>
>>> There is an API for launching a binary build from a build config - you
>>> can do it from a curl call if necessary (run with --loglevel=8 to see an
>>> example of that call).  You must send as the contents of the POST call the
>>> source to build as a tar, zip, or tar.gz
>>>
>>> On Sep 27, 2016, at 6:35 AM, Ben Parees <[email protected]> wrote:
>>>
>>>
>>>
>>> On Sep 27, 2016 2:10 AM, "Lionel Orellana" <[email protected]> wrote:
>>> >
>>> > Hi
>>> >
>>> > Is it possible to trigger a binary build in Jenkins using
>>> the openshiftBuild step?
>>> >
>>> > I'm basically trying to run something like
>>> >
>>> > oc start-build <bc> --from-dir=<dir>
>>> >
>>> > but there's no option to pass from-dir in the openshiftBuild step. Are
>>> there plans to support this?
>>>
>>> It's not possible today, but yes it is on our list. In the meantime you
>>> can shell out and invoke oc directly to accomplish the same thing.
>>>
>>> >
>>> > Thanks
>>> >
>>> >
>>> > Lionel.
>>> >
>>> > _______________________________________________
>>> > users mailing list
>>> > [email protected]
>>> > http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>> >
>>>
>>> _______________________________________________
>>> users mailing list
>>> [email protected]
>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>>
>>>
>>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>
>
>
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to