Commit 4ceb008a authored by zowoq's avatar zowoq
Browse files

terraform-providers: add license/spdx

parent d0594d56
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ let
    ({ owner
     , repo
     , rev
     , spdx ? "UNSET"
     , version ? lib.removePrefix "v" rev
     , hash ? throw "use hash instead of sha256" # added 2202/09
     , vendorHash ? throw "use vendorHash instead of vendorSha256" # added 2202/09
@@ -47,6 +48,7 @@ let

        meta = {
          inherit homepage;
          license = lib.getLicenseFromSpdxId spdx;
        };

        # Move the provider to libexec
@@ -77,6 +79,8 @@ let
      netlify = automated-providers.netlify.overrideAttrs (_: { meta.broken = stdenv.isDarwin; });
      pass = automated-providers.pass.overrideAttrs (_: { meta.broken = stdenv.isDarwin; });
      tencentcloud = automated-providers.tencentcloud.overrideAttrs (_: { meta.broken = stdenv.isDarwin; });
      # github api seems to be broken, doesn't just fail to recognize the license, it's ignored entirely.
      checkly = automated-providers.checkly.override { spdx = "MIT"; };
      gitlab = automated-providers.gitlab.override { mkProviderFetcher = fetchFromGitLab; owner = "gitlab-org"; };
      # mkisofs needed to create ISOs holding cloud-init data and wrapped to terraform via deecb4c1aab780047d79978c636eeb879dd68630
      libvirt = automated-providers.libvirt.overrideAttrs (_: { propagatedBuildInputs = [ cdrtools ]; });
+141 −0

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -21,5 +21,5 @@ ${providers[*]}
EOF

for provider in "${providers[@]}"; do
  ./update-provider "$@" "${provider}"
  ./update-provider --no-spdx "$@" "${provider}"
done
+11 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ DOC
build=1
force=
provider=
spdx=1

while [[ $# -gt 0 ]]; do
  case "$1" in
@@ -49,6 +50,10 @@ while [[ $# -gt 0 ]]; do
    build=0
    shift
    ;;
  --no-spdx)
    spdx=0
    shift
    ;;
  *)
    if [[ -n ${provider} ]]; then
      echo "ERROR: provider name was passed two times: '${provider}' and '$1'"
@@ -130,6 +135,12 @@ org="$(echo "${provider_source_url}" | cut -d '/' -f 4)"
update_attr owner "${org}"
repo="$(echo "${provider_source_url}" | cut -d '/' -f 5)"
update_attr repo "${repo}"

if [[ ${spdx} == 1 ]]; then
  spdx="$(curl -L -s "https://api.github.com/repos/${org}/${repo}/license" | jq -r '.license.spdx_id')"
  update_attr spdx "${spdx}"
fi

echo_provider "calculating hash"
hash=$(generate_hash src)
update_attr hash "${hash}"