openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 183 forks source link

[Helm] Add logic to define BUILD_PATH based on '_service' file #945

Open arsenalpoll opened 1 year ago

arsenalpoll commented 1 year ago

This commit adds a block of code that checks if the _service directory exists. If it does, it parses the _service file to extract the filename and extract parameters. It then uses these values to define the BUILD_PATH.

adrianschroeter commented 1 year ago

A source directory in build area that you parse as xml????

Sorry, this looks highly suspicious, did you execute it once at least?

arsenalpoll commented 1 year ago

A source directory in build area that you parse as xml????

Sorry, this looks highly suspicious, did you execute it once at least?

@adrianschroeter Hi, thank you very much for your reply.

This is my use example:

<services>
  <service name="obs_scm">
      <param name="scm">git</param>
      <param name="url">http://gitlab.xx.xx/abc/xyz.git</param>
      <param name="version">_none_</param>
      <param name="revision">origin/dev</param>
      <param name="filename">abc_xyz</param>
      <param name="extract">build/charts/crd/Chart.yaml</param>    
  </service>
</services>

Chart.yaml is extracted from the Git storage repository. helm package command needs to be executed within the path where the Chart.yaml is located, so I added the specified path.

My example helm chart abc_xyz.tgz directory tree:

[root@arsenal ]# tree abc_xyz
abc_xyz
├── Chart.yaml
├── templates
│   ├── k8s.ovn.org_routes.yaml
│   ├── network-crd.yaml
│   └── subnet-crd.yaml
└── values.yaml

Content under the git repository path build/charts/crd/ image