BCDevOps/bcdk

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

Opened this issue · 0 comments

  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 'my_value', 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),