BCDevOps / bcdk

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

Errors thrown when run "npm run build" on linux. #103

Open kuanfandevops opened 2 years ago

kuanfandevops commented 2 years ago
  1. When run "npm run build -- --pr=80", it has no issues if run on local mac os, but it throws the following error when run on Linux.

Error: command: oc --namespace=30b186-tools apply -f - --output=name stderr:The BuildConfig "cthub-frontend-build-80" is invalid: metadata.labels: Invalid value: "https://github.com/bcgov/cthub": 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])?')

  1. The following code causes the above issue. The value of github-repo can not be a git repo url. const envLabels = { 'env-name': envName, 'env-id': envId, 'github-repo': this.git.repository, 'github-owner': this.git.owner, }; Recommend to use the below code. The lib/clean.js needs to be updated as well. 'github-repo': this.git.repository.substr(this.git.repository.lastIndexOf("/")+1),