BCDevOps / bcdk

BC Developer Kit
Apache License 2.0
6 stars 15 forks source link

Need to validate module name per OpenShift label rules #12

Closed ActionAnalytics closed 5 years ago

ActionAnalytics commented 5 years ago

pipeline@1.0.0 build /Users/billy/git/bcdk-test/.jenkins/.pipeline node build.js "--pr=0" "--dev-mode=true"

Error: command: oc --namespace=mem-mmti-tools apply -f - --output=name stderr:Error from server (Invalid): BuildConfig.build.openshift.io "jenkins20190411-build-0" is invalid: metadata.labels: Invalid value: "https://github.com/ActionAnalytics/bcdk-test": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'myvalue', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?') Error from server (Invalid): BuildConfig.build.openshift.io "jenkins20190411-slave-main-build-0" is invalid: metadata.labels: Invalid value: "https://github.com/ActionAnalytics/bcdk-test": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'myvalue', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?')

at OpenShiftClientX._action (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:167:13)
at OpenShiftClientX.objectDefAction (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:387:19)
at OpenShiftClientX.apply (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:457:25)
at OpenShiftClientX.applyAndBuild (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClientX.js:495:28)
at module.exports (/Users/billy/git/bcdk-test/.jenkins/.pipeline/lib/build.js:34:6)
at Object.<anonymous> (/Users/billy/git/bcdk-test/.jenkins/.pipeline/build.js:5:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pipeline@1.0.0 build: node build.js "--pr=0" "--dev-mode=true" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pipeline@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/billy/.npm/_logs/2019-04-12T21_27_09_548Z-debug.log

ActionAnalytics commented 5 years ago

Even with the stock default "jenkins" name still have this issue:

pipeline@1.0.0 build /Users/billy/git/bcdk-test/.jenkins/.pipeline node build.js "--pr=0" "--dev-mode=true"

Error: command: oc --namespace=mem-mmti-tools apply -f - --output=name stderr:Error from server (Invalid): BuildConfig.build.openshift.io "jenkins-build-0" is invalid: metadata.labels: Invalid value: "https://github.com/ActionAnalytics/bcdk-test": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'myvalue', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?') Error from server (Invalid): BuildConfig.build.openshift.io "jenkins-slave-main-build-0" is invalid: metadata.labels: Invalid value: "https://github.com/ActionAnalytics/bcdk-test": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'myvalue', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?')

at OpenShiftClientX._action (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:167:13)
at OpenShiftClientX.objectDefAction (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:387:19)
at OpenShiftClientX.apply (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClient.js:457:25)
at OpenShiftClientX.applyAndBuild (/Users/billy/git/bcdk-test/.jenkins/.pipeline/node_modules/pipeline-cli/lib/OpenShiftClientX.js:495:28)
at module.exports (/Users/billy/git/bcdk-test/.jenkins/.pipeline/lib/build.js:34:6)
at Object.<anonymous> (/Users/billy/git/bcdk-test/.jenkins/.pipeline/build.js:5:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pipeline@1.0.0 build: node build.js "--pr=0" "--dev-mode=true" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pipeline@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/billy/.npm/_logs/2019-04-12T21_42_23_041Z-debug.log

ActionAnalytics commented 5 years ago

It was the git remote -v origin https://github.com/ActionAnalytics/bcdk-test (fetch) origin https://github.com/ActionAnalytics/bcdk-test (push)

was missing ".git" at the end

fix was to git remote set-url origin https://github.com/ActionAnalytics/bcdk-test.git

git remote -v origin https://github.com/ActionAnalytics/bcdk-test.git (fetch) origin https://github.com/ActionAnalytics/bcdk-test.git (push)

cvarjao commented 5 years ago

This was fixed with bcdevops/pipeline-cli@6f85a5b726499be31412ff5d533f95091096bf60