-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking for openshift yaml recursively in the current directory #23
Conversation
try { | ||
new File('.').eachFileRecurse(FILES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does FILES come from? I think that needs to be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes my bad, I missed the import statement import static groovy.io.FileType.FILES
. I kinda did a mock testing where I had imported it.
try { | ||
new File('.').eachFileRecurse(FILES) { | ||
if(it.name.endsWith('openshift.yml')) { | ||
def openshiftYaml = it.absolutePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The def openshiftYaml
here means the rest of the function cant see it. You can define openshiftYaml
variable at the top of the method.
ok thanks @rupalibehera! I added a couple of comments. FWIW I tested the changes using this inline jenkins pipeline script, you can copy / paste it youself into a new Jenkins pipeline job created via the jenkins UI..
|
b4bd9de
to
5d5fa11
Compare
ae97bbd
to
64ef250
Compare
@rawlingsj , I have tested the above PR as suggested by you and it works fine now, let me know if you have anymore reviews on this ? |
Could you rebase this PR please @rupalibehera and we'll get it merged in |
@@ -498,10 +498,10 @@ def getServiceURL(String serviceName, String namespace = null, String protocol = | |||
} | |||
|
|||
def isOpenShiftS2I() { | |||
def openshiftYaml = "target/classes/META-INF/fabric8/openshift.yml" | |||
def openshiftYaml = findFiles(glob: '**/openshift.yml') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about if this finds multiple files? Should they all be checked or just the first one as you're doing below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we will have multiple files, as we can see above in the diff we were earlier just checking for one file in the same location now we are just checking for it recursively in the same directory.
9af6176
to
8c09649
Compare
@rawlingsj , I have rebased the PR |
@rawlingsj , can we merge this one ? |
[merge] |
checking recursively for openshift.yml and removed the hardcoded path for openshift.yaml
#13
cc: @rawlingsj