Giter VIP home page Giter VIP logo

Comments (7)

thikade avatar thikade commented on July 2, 2024

Can you give some more details, eg code snippets, on what you are doing and what fails?
Sounds like you are doing st. related to "oc new-app" command!?

from jenkins-client-plugin.

KiqoCode avatar KiqoCode commented on July 2, 2024

openshift.newApp( 'https://stash.tre.se/scm/itopstools/alerta-oc.git', '--source-secret=repo-at-bitbucket' )
This is the step that's failing in jenkins, and what I understand is that it triggers a oc new-app command in the cluster..

And what we get is this:

ERROR: new-app returned an error;
{err=error: unable to load template file "https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc": error parsing https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc: error converting YAML to JSON: yaml: line 16: did not find expected <document start>
error: git ls-remote failed with: fatal: https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc/info/refs not valid: is this a git repository?;  local file access failed with: stat https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc: no such file or directory
error: unable to locate any images in image streams, templates loaded in accessible projects, template files, local docker images with name "https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc"

Argument 'https://stash.tre.se/projects/ITOPSTOOLS/repos/alerta-oc' was classified as an image, image~source, or loaded template reference.

So it seems this is not recognized as a git repo by oc. So can we in the openshift.newApp command specify that this is actually a git repo? We know connection works between our cluster and this git repo atleast. The repo is BitBucket.

from jenkins-client-plugin.

thikade avatar thikade commented on July 2, 2024

Try to get the new-app cmd working on the cmdline first, to fix the error(s).
Use oc new-app https://stash.tre.se/scm/itopstools/alerta-oc.git --source-secret=repo-at-bitbucket and see what that gives you.

On OCP v4.8 (and on all previous versions iirc), oc new-app will connect to the specified git repo and then tries to figure out which type of project is kept inside the repo (Java, NodeJS, ... ), to determine the Source2Image builder-image to use in the BuildConfig.
Unfortunately new-app does not use the credentials given in the secret, but prompts for interactive authentication. So - that way it wont work from Jenkins pipeline. (Note, the source-secret is only used inside the generated Buildconfig!)

But you can override new-app's behaviour by forcing it to use a S2I builder image using the tilde-syntax:
eg: use the httpd builder image from Openshift:
oc new-app httpd~https://stash.tre.se/scm/itopstools/alerta-oc.git --source-secret=repo-at-bitbucket
This should give you a few K8s/OCP manifests: Imagestream, BuildConfig, Deployment, Service

Personally, I would not use new-app inside a Jenkins pipeline. I would generate all required YAML manifests once and put them into Git. In my pipeline I would checkout that repo, then apply these YAMLs ... but in the end that's your decision, and ymmv.

Regards
Thomas

from jenkins-client-plugin.

openshift-bot avatar openshift-bot commented on July 2, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

from jenkins-client-plugin.

openshift-bot avatar openshift-bot commented on July 2, 2024

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

from jenkins-client-plugin.

openshift-bot avatar openshift-bot commented on July 2, 2024

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

from jenkins-client-plugin.

openshift-ci avatar openshift-ci commented on July 2, 2024

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from jenkins-client-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.