Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-3265

UI frontend build fails for exported checkout which has no .git dir

    XMLWordPrintable

Details

    Description

      In ui/packages/ui/webpack.common.js:9 the COMMIT_HASH is loaded from `git rev-parse --short HEAD`. When git is not available that command fails. The build should FAIL in that case or when the result isn't a proper SHA hash.

      The COMMIT_HASH must then either provided from an environment variable or git needs to be installed in the build environment.

      For example, I tried to build the image with OpenShift Pipelines. The git-clone task works like an export (no .git dir available after successful checkout) which means git commands won't work in that kind of repository checkout.
      The build is then failing like:

      [build-image : build] [INFO] fatal: not a git repository (or any of the parent directories): .git
      [build-image : build] [INFO] [webpack-cli] Failed to load '/javabuild/ui/packages/ui/webpack.prod.js' config
      [build-image : build] [INFO] [webpack-cli] Error: Command failed: git rev-parse --short HEAD
      [build-image : build] [INFO] fatal: not a git repository (or any of the parent directories): .git
      

      Either we accept that hard exception or we catch it and provide a better error message. WDYT?

      Attachments

        Activity

          People

            asansari@redhat.com Ashique Ansari
            rk3rn3r René Kerner
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: