Uploaded image for project: 'Red Hat CodeReady Studio (devstudio)'
  1. Red Hat CodeReady Studio (devstudio)
  2. JBDS-4293

Merge requirements-*.json files into one

XMLWordPrintable

    • devex #128 February 2017, devex #129 March 2017
    • 7
    • NEW

      Current implementation is looking for requirements-${process.platform}.json. There are three supported platforms and therefore three configuration file with duplicated information for some components.
      New implementation should merge configuration in one file and introduce platform attribute for component configuration's. Only components that has platform specific binaries are affected.

      For example for CDK configuration instead of having it defined in three files like this:

      requirements-win32.json
      {
        "cdk": {
          "name": "Red Hat Container Development Kit",
          "description": "Developer Tools for Creating, Testing, and Distributing Red Hat Container-Based Applications",
          "bundle": "yes",
          "version": "3.0.0.GA",
          "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/windows-amd64/minishift.exe",
          "url": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/windows-amd64/minishift.exe",
          "filename": "minishift.exe",
          "sha256sum": "984318638a5c0d67ae4483bb508f6b90b99f885153dc525660bfff07fa883c94",
          "vendor": "Red Hat, Inc."
        }
      }
      
      requirements-darwin.json
      {
        "cdk": {
          "name": "Red Hat Container Development Kit",
          "description": "Developer Tools for Creating, Testing, and Distributing Red Hat Container-Based Applications",
          "bundle": "yes",
          "version": "3.0.0.GA",
          "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/darwin-amd64/minishift",
          "url": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/darwin-amd64/minishift",
          "filename": "minishift",
          "sha256sum": "1e7472175e25d9d197149a3ed2192440a1f581f1884cf2b2c77d97674ee73e5e",
          "vendor": "Red Hat, Inc."
        }
      }
      
      requirements-linux.json
      {
        "cdk": {
          "name": "Red Hat Container Development Kit",
          "description": "Developer Tools for Creating, Testing, and Distributing Red Hat Container-Based Applications",
          "bundle": "yes",
          "version": "3.0.0.GA",
          "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/linux-amd64/minishift",
          "url": "http://cdk-builds.usersys.redhat.com/builds/weekly/25-Jan-2017.3.0_alpha.2/linux-amd64/minishift",
          "filename": "linux-amd64.tar.gz",
          "sha256sum": "76da07d4065eb387093af1316371a19c11982b4b9270eff14bca84db69e2bb32",
          "vendor": "Red Hat, Inc."
        }
      }
      

      It would be defined only once like this

      requirements.json
      {
        "cdk": {
          "name": "Red Hat Container Development Kit",
          "description": "Developer Tools for Creating, Testing, and Distributing Red Hat Container-Based Applications",
          "bundle": "yes",
          "version": "3.0.0.GA",
          "vendor": "Red Hat, Inc."
          platform: {
            win32: {
              "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/windows-amd64/minishift.exe",
              "url": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/windows-amd64/minishift.exe",
              "filename": "minishift.exe",
              "sha256sum": "984318638a5c0d67ae4483bb508f6b90b99f885153dc525660bfff07fa883c94"
            },
            darwin: {
              "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/darwin-amd64/minishift",
              "url": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/darwin-amd64/minishift",
              "filename": "minishift",
              "sha256sum": "1e7472175e25d9d197149a3ed2192440a1f581f1884cf2b2c77d97674ee73e5e"
            },
            linux: {
              "dmUrl": "http://cdk-builds.usersys.redhat.com/builds/nightly/11-Feb-2017/linux-amd64/minishift",
              "url": "http://cdk-builds.usersys.redhat.com/builds/weekly/25-Jan-2017.3.0_alpha.2/linux-amd64/minishift",
              "filename": "linux-amd64.tar.gz",
              "sha256sum": "76da07d4065eb387093af1316371a19c11982b4b9270eff14bca84db69e2bb32"
            }
          }
        }
      }
      

      Note that requirements files used as is in tests, they also transformed during the build and final file is landed in 'transpiled' folder.

              rhn-engineering-sverma Sudhir Verma (Inactive)
              nivologd@gmail.com Denis Golovin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: