repositories

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Overview

Package repositories contains actual implementations of the repository interfaces defined in the `core` package. It currently supports Google Cloud Storage (GCS) for Bazel releases, release candidates and Bazel binaries built at arbitrary commits. Moreover, it supports GitHub for Bazel forks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCSRepo

type GCSRepo struct{}

GCSRepo represents a Bazel repository on Google Cloud Storage that contains Bazel releases, release candidates and Bazel binaries built at arbitrary commits. It can return all available Bazel versions, as well as downloading a specific version.

func (*GCSRepo) DownloadAtCommit

func (gcs *GCSRepo) DownloadAtCommit(commit, destDir, destFile string) (string, error)

DownloadAtCommit downloads a Bazel binary built at the given commit into the specified location and returns the absolute path.

func (*GCSRepo) DownloadCandidate

func (gcs *GCSRepo) DownloadCandidate(version, destDir, destFile string) (string, error)

DownloadCandidate downloads the given release candidate into the specified location and returns the absolute path.

func (*GCSRepo) DownloadRelease

func (gcs *GCSRepo) DownloadRelease(version, destDir, destFile string) (string, error)

DownloadRelease downloads the given Bazel release into the specified location and returns the absolute path.

func (*GCSRepo) DownloadRolling added in v1.12.0

func (gcs *GCSRepo) DownloadRolling(version, destDir, destFile string) (string, error)

DownloadRolling downloads the given Bazel version into the specified location and returns the absolute path.

func (*GCSRepo) GetCandidateVersions

func (gcs *GCSRepo) GetCandidateVersions(bazeliskHome string) ([]string, error)

GetCandidateVersions returns all versions of available release candidates for the latest release in this repository.

func (*GCSRepo) GetLastGreenCommit

func (gcs *GCSRepo) GetLastGreenCommit(bazeliskHome string, downstreamGreen bool) (string, error)

GetLastGreenCommit returns the most recent commit at which a Bazel binary passed a specific Bazel CI pipeline. If downstreamGreen is true, the pipeline is https://buildkite.com/bazel/bazel-at-head-plus-downstream, otherwise it's https://buildkite.com/bazel/bazel-bazel

func (*GCSRepo) GetReleaseVersions

func (gcs *GCSRepo) GetReleaseVersions(bazeliskHome string, filter core.ReleaseFilter) ([]string, error)

GetReleaseVersions returns the versions of all available Bazel releases in this repository that match the given filter.

func (*GCSRepo) GetRollingVersions added in v1.12.0

func (gcs *GCSRepo) GetRollingVersions(bazeliskHome string) ([]string, error)

GetRollingVersions returns a list of all available rolling release versions for the newest release.

type GcsListResponse

type GcsListResponse struct {
	// Prefixes contains the available string prefixes.
	Prefixes []string `json:"prefixes"`

	// Items contains the names of available objects in the current GCS bucket.
	Items []interface{} `json:"items"`

	// Optional token when the result is paginated.
	NextPageToken string `json:"nextPageToken"`
}

GcsListResponse represents the result of listing the contents of a GCS bucket. Public for testing

type GitHubRepo

type GitHubRepo struct {
	// contains filtered or unexported fields
}

GitHubRepo represents a fork of Bazel hosted on GitHub, and provides a list of all available Bazel binaries in that repo, as well as the ability to download them.

func CreateGitHubRepo

func CreateGitHubRepo(token string) *GitHubRepo

CreateGitHubRepo instantiates a new GitHubRepo.

func (*GitHubRepo) DownloadVersion

func (gh *GitHubRepo) DownloadVersion(fork, version, destDir, destFile string) (string, error)

DownloadVersion downloads a Bazel binary for the given version and fork to the specified location and returns the absolute path.

func (*GitHubRepo) GetVersions

func (gh *GitHubRepo) GetVersions(bazeliskHome, bazelFork string) ([]string, error)

GetVersions returns the versions of all available Bazel binaries in the given fork.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL