cockroach: Index | Files

package release

import ""

Package release contains utilities for assisting with the release process. This is intended for use for the release commands.


Package Files



var CRDBSharedLibraries = []string{"libgeos", "libgeos_c"}

CRDBSharedLibraries are all the shared libraries for CRDB, without the extension.

var (
    // NoCache is a string constant to send no-cache to AWS.
    NoCache = "no-cache"
var SupportedTargets = []SupportedTarget{
    {BuildType: "linux-gnu", Suffix: ".linux-2.6.32-gnu-amd64"},
    {BuildType: "darwin", Suffix: ".darwin-10.9-amd64"},
    {BuildType: "windows", Suffix: ".windows-6.2-amd64.exe"},

SupportedTargets contains the supported targets that we build.

func MakeRelease Uses

func MakeRelease(b SupportedTarget, pkgDir string, opts ...MakeReleaseOption) error

MakeRelease makes the release binary and associated files.

func MakeWorkload Uses

func MakeWorkload(pkgDir string) error

MakeWorkload makes the bin/workload binary.

func PutNonRelease Uses

func PutNonRelease(svc S3Putter, o PutNonReleaseOptions)

PutNonRelease uploads non-release related files to S3. Files are uploaded to /cockroach/<S3FilePath> for each non release file. A latest key is then put at cockroach/<S3RedirectPrefix>.<BranchName> that redirects to the above file.

func PutRelease Uses

func PutRelease(svc S3Putter, o PutReleaseOptions)

PutRelease uploads a compressed archive containing the release files to S3.

func S3KeyRelease Uses

func S3KeyRelease(suffix string, buildType string, versionStr string) (string, string)

S3KeyRelease extracts the target archive base and archive name for the given parameters.

func SharedLibraryExtensionFromBuildType Uses

func SharedLibraryExtensionFromBuildType(buildType string) string

SharedLibraryExtensionFromBuildType returns the extensions for a given buildType.

func TrimDotExe Uses

func TrimDotExe(name string) (string, bool)

TrimDotExe trims '.exe. from `name` and returns the result (and whether any trimming has occurred).

type ArchiveFile Uses

type ArchiveFile struct {
    // LocalAbsolutePath is the location of the file to upload include in the archive on the local OS.
    LocalAbsolutePath string
    // ArchiveFilePath is the location of the file within the archive in which the file is to be stored.
    ArchiveFilePath string

ArchiveFile is a file to store in the a archive for a release.

func MakeCRDBBinaryArchiveFile Uses

func MakeCRDBBinaryArchiveFile(base string, localAbsolutePath string) ArchiveFile

MakeCRDBBinaryArchiveFile generates the ArchiveFile object for a CRDB binary.

func MakeCRDBLibraryArchiveFiles Uses

func MakeCRDBLibraryArchiveFiles(localBasePath string, buildType string) []ArchiveFile

MakeCRDBLibraryArchiveFiles generates the ArchiveFile object for relevant CRDB helper libraries.

type ExecFn Uses

type ExecFn func(*exec.Cmd) ([]byte, error)

ExecFn is a mockable wrapper that executes the given command.

var DefaultExecFn ExecFn = func(c *exec.Cmd) ([]byte, error) {
    if c.Stdout != nil {
        return nil, errors.New("exec: Stdout already set")
    var stdout bytes.Buffer
    c.Stdout = io.MultiWriter(&stdout, os.Stdout)
    err := c.Run()
    return stdout.Bytes(), err

DefaultExecFn is the default exec function.

type MakeReleaseOption Uses

type MakeReleaseOption func(makeReleaseAndVerifyOptions) makeReleaseAndVerifyOptions

MakeReleaseOption as an option for the MakeRelease function.

func WithMakeReleaseOptionBuildArg Uses

func WithMakeReleaseOptionBuildArg(arg string) MakeReleaseOption

WithMakeReleaseOptionBuildArg adds a build argument to release.

func WithMakeReleaseOptionExecFn Uses

func WithMakeReleaseOptionExecFn(r ExecFn) MakeReleaseOption

WithMakeReleaseOptionExecFn changes the exec function of the given execFn.

type NonReleaseFile Uses

type NonReleaseFile struct {
    // S3FileName is the name of the file stored in S3.
    S3FileName string
    // S3FilePath is the path the file should be stored within the  Cockroach bucket.
    S3FilePath string
    // S3RedirectPathPrefix is the prefix of the path that redirects  to the S3FilePath.
    // It is suffixed with .VersionStr or .LATEST, depending on whether  the branch is
    // the master branch.
    S3RedirectPathPrefix string

    // LocalAbsolutePath is the location of the file to upload in the local OS.
    LocalAbsolutePath string

NonReleaseFile is a file to upload when publishing a non-release.

func MakeCRDBBinaryNonReleaseFile Uses

func MakeCRDBBinaryNonReleaseFile(
    base string, localAbsolutePath string, versionStr string,
) NonReleaseFile

MakeCRDBBinaryNonReleaseFile creates a NonRelease object for the CRDB binary.

func MakeCRDBLibraryNonReleaseFiles Uses

func MakeCRDBLibraryNonReleaseFiles(
    localAbsoluteBasePath string, buildType string, versionStr string, suffix string,
) []NonReleaseFile

MakeCRDBLibraryNonReleaseFiles creates the NonReleaseFile objects for relevant CRDB shipped libraries.

type PutNonReleaseOptions Uses

type PutNonReleaseOptions struct {
    // Branch is the branch from which the release is being uploaded from.
    Branch string
    // BucketName is the bucket to upload the files to.
    BucketName string

    // Files are all the files to be uploaded into S3.
    Files []NonReleaseFile

PutNonReleaseOptions are options to pass into PutNonRelease.

type PutReleaseOptions Uses

type PutReleaseOptions struct {
    // BucketName is the bucket to upload the files to.
    BucketName string
    // NoCache is true if we should set the NoCache option to S3.
    NoCache bool
    // Suffix is the suffix of the main CRDB binary.
    Suffix string
    // BuildType is the build type of the release.
    BuildType string
    // VersionStr is the version (SHA/branch name) of the release.
    VersionStr string

    // Files are all the files to be included in the archive.
    Files []ArchiveFile

PutReleaseOptions are options to for the PutRelease function.

type S3Putter Uses

type S3Putter interface {
    PutObject(*s3.PutObjectInput) (*s3.PutObjectOutput, error)

S3Putter is an interface allowing uploads to S3.

type SupportedTarget Uses

type SupportedTarget struct {
    BuildType string
    Suffix    string

SupportedTarget contains metadata about a supported target.

Package release imports 16 packages (graph) and is imported by 2 packages. Updated 2020-08-12. Refresh now. Tools for package owners.