Module: Dependabot::Helm::Helpers

Extended by:
T::Sig
Defined in:
lib/dependabot/helm/helpers.rb

Class Method Summary collapse

Class Method Details

.add_repo(repo_name, repository_url) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/dependabot/helm/helpers.rb', line 26

def self.add_repo(repo_name, repository_url)
  Dependabot.logger.info("Adding Helm repository: #{repo_name} (#{repository_url})")

  Dependabot::SharedHelpers.run_shell_command(
    "helm repo add #{repo_name} #{repository_url}",
    fingerprint: "helm repo add <repo_name> <repository_url>"
  )
end

.fetch_oci_tags(name) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/dependabot/helm/helpers.rb', line 56

def self.fetch_oci_tags(name)
  Dependabot.logger.info("Searching OCI tags for: #{name}")

  Dependabot::SharedHelpers.run_shell_command(
    "oras repo tags #{name}",
    fingerprint: "oras repo tags <name>"
  ).strip
end

.fetch_tags_with_release_date_using_oci(repo_url, tag) ⇒ Object



66
67
68
69
70
71
# File 'lib/dependabot/helm/helpers.rb', line 66

def self.fetch_tags_with_release_date_using_oci(repo_url, tag)
  Dependabot::SharedHelpers.run_shell_command(
    "oras manifest fetch #{repo_url}:#{tag}",
    fingerprint: "oras manifest fetch <repo_url>:<tag>"
  ).strip
end

.search_releases(name) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/dependabot/helm/helpers.rb', line 16

def self.search_releases(name)
  Dependabot.logger.info("Searching Helm repository for: #{name}")

  Dependabot::SharedHelpers.run_shell_command(
    "helm search repo #{name} --versions --output=json",
    fingerprint: "helm search repo <name> --versions --output=json"
  ).strip
end

.update_lockObject



46
47
48
49
50
51
52
53
# File 'lib/dependabot/helm/helpers.rb', line 46

def self.update_lock
  Dependabot.logger.info("Updating Building Lock File")

  Dependabot::SharedHelpers.run_shell_command(
    "helm dependency update",
    fingerprint: "helm dependency update"
  )
end

.update_repoObject



36
37
38
39
40
41
42
43
# File 'lib/dependabot/helm/helpers.rb', line 36

def self.update_repo
  Dependabot.logger.info("Updating Helm repositories")

  Dependabot::SharedHelpers.run_shell_command(
    "helm repo update",
    fingerprint: "helm repo update"
  )
end