buildmodel

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package buildmodel contains utilities to read, write, and modify files that are related to the Microsoft build of Go.

Index

Constants

This section is empty.

Variables

View Source
var NoMajorMinorUpgradeMatchError = errors.New("no match found in existing versions.json file")

NoMajorMinorUpgradeMatchError indicates that while running UpdateVersions, the input assets file didn't match any major.minor versions and no update could be performed.

Functions

func EnsureDockerfileGenerationPrerequisites

func EnsureDockerfileGenerationPrerequisites() error

EnsureDockerfileGenerationPrerequisites checks if Dockerfile generation prerequisites are satisfied and returns a descriptive error if not.

func GenerateBuildAssetJSON

func GenerateBuildAssetJSON(f *BuildAssetJSONFlags) error

GenerateBuildAssetJSON uses the specified parameters to summarize a build in a build asset JSON file.

func ParseBoundFlags

func ParseBoundFlags(description string)

ParseBoundFlags parses all flags that have been registered with the flag package. This function handles '-help' and validates no unhandled args were passed, so may exit rather than returning.

func RunDockerfileGeneration

func RunDockerfileGeneration(repoRoot string, forceSubmoduleReset bool) error

RunDockerfileGeneration runs the Dockerfile generation script in the given go-images repo root. Call this after updating the versions.json file to synchronize the Dockerfiles. This function doesn't check for prerequisites: EnsureDockerfileGenerationPrerequisites should be called before any auto-update code runs to detect problems before wasting time on an incompletable update.

func RunUpdate

func RunUpdate(repoRoot string, f *UpdateFlags) error

RunUpdate updates the given Go Docker image repository with the provided flags.

func SubmitUpdatePR

func SubmitUpdatePR(f *PRFlags) error

SubmitUpdatePR runs an auto-update in a temp Git repo. If GitHub credentials are provided, submits the resulting commit as a GitHub PR, approves with a second account, and enables the GitHub auto-merge feature.

func UpdateGoImagesRepo

func UpdateGoImagesRepo(repoRoot string, b *buildassets.BuildAssets) error

UpdateGoImagesRepo runs an auto-update process in the given Go Docker images repository. It finds the 'versions.json' and 'manifest.json' files and updates them based on the given build assets struct. If the struct pointer is nil, only updates the 'manifest.json'.

func UpdateManifest

func UpdateManifest(manifest *dockermanifest.Manifest, versions dockerversions.Versions)

UpdateManifest takes a 'versions.json' model and updates a build manifest to make it build and tag all versions specified. Slices in the generated model are sorted, for diff stability. Map stability is handled by the Go JSON library when the model is serialized.

func UpdateVersions

func UpdateVersions(assets *buildassets.BuildAssets, versions dockerversions.Versions) error

UpdateVersions takes a build asset file containing a list of build outputs and updates a versions.json model to consume the new build.

Types

type BuildAssetJSONFlags

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

BuildAssetJSONFlags is a list of flags to create a build asset JSON file.

func BindBuildAssetJSONFlags

func BindBuildAssetJSONFlags() *BuildAssetJSONFlags

BindBuildAssetJSONFlags creates BuildAssetJSONFlags with the 'flag' package, globally registering them in the flag package so ParseBoundFlags will find them.

type PRFlags

type PRFlags struct {
	UpdateFlags
	sync.AzDOVariableFlags
	// contains filtered or unexported fields
}

PRFlags is a list of flags used to submit a Docker update PR.

func BindPRFlags

func BindPRFlags() *PRFlags

BindPRFlags creates PRFlags with the 'flag' package, globally registering them in the flag package so ParseBoundFlags will find them.

type UpdateFlags

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

UpdateFlags is a list of flags used for an update command.

func BindUpdateFlags

func BindUpdateFlags() *UpdateFlags

BindUpdateFlags creates UpdateFlags with the 'flag' package, globally registering them in the flag package so ParseBoundFlags will find them.

Directories

Path Synopsis
Package buildassets represents a build asset JSON file that describes the output of a Go build.
Package buildassets represents a build asset JSON file that describes the output of a Go build.
Package dockermanifest represents the .NET Docker tooling's 'manifest.json' file.
Package dockermanifest represents the .NET Docker tooling's 'manifest.json' file.
Package dockerversions represents a Go Docker 'versions.json' file.
Package dockerversions represents a Go Docker 'versions.json' file.

Jump to

Keyboard shortcuts

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