Comments (7)
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.
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.
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.
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.
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.
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-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)
- Plugin incompatible with new-style clouds configuration. HOT 5
- Error after Warning HOT 7
- Can't get api token from com.openshift.jenkins.plugnis.OpenShiftTokenCredentials in pipeline HOT 5
- List of DSL methods required HOT 3
- Error to parse POM's HOT 4
- 'restart' subcommand is missing for rollout()
- Support current version of oc tool HOT 4
- Plugin installation broke credentials used by other plugins HOT 12
- Leftover oc processes after wait() calls HOT 7
- Plugin doesn't detect capabilities (--ignore-not-found) from recent OC versions HOT 8
- No credentials shown in cluster configuration dropdown HOT 6
- Job fails if there are spaces in the project name, using raw command HOT 9
- Error flags cannot be placed before plugin name on external Jenkins declarative pipeline HOT 2
- Unable to retrieve object names using kubernetes-plugin sidecar container HOT 5
- java.nio.file.NoSuchFileException after upgrade to 1.0.37 HOT 5
- Certificate options not escaped HOT 5
- stdout and stderr not correctly splited when running with kubernetes plugin
- Future Release Branches Frozen For Merging | branch:release-4.16 branch:release-4.17
- stdout and stderr not correctly splitted when running with kubernetes plugin (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jenkins-client-plugin.