archive

package
v0.0.0-...-e37a79b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ControlTemplate = `` /* 583-byte string literal not displayed */

Variables

View Source
var (
	ExtensionMap = map[string]string{
		"bionic":   "deb",
		"bookworm": "deb",
		"bullseye": "deb",
		"buster":   "deb",
		"focal":    "deb",
		"jammy":    "deb",
		"noble":    "deb",
		"rhel9":    "rpm",
		"rhel8":    "rpm",
		"centos7":  "rpm",
		"mariner2": "rpm",
		"windows":  "zip",
	}

	OSMap = map[string]string{
		"bookworm": "debian",
		"bullseye": "debian",
		"buster":   "debian",
		"bionic":   "ubuntu",
		"focal":    "ubuntu",
		"jammy":    "ubuntu",
		"noble":    "ubuntu",
		"rhel9":    "el9",
		"rhel8":    "el8",
		"centos7":  "el7",
		"mariner2": "cm2",
		"windows":  "windows",
	}

	VersionMap = map[string]string{
		"bookworm": "12",
		"bullseye": "11",
		"buster":   "10",
		"bionic":   "18.04",
		"focal":    "20.04",
		"jammy":    "22.04",
		"noble":    "24.04",
		"rhel9":    "el9",
		"rhel8":    "el8",
		"centos7":  "el7",
		"mariner2": "cm2",
	}
)
View Source
var (
	DebDistroMap = map[string]string{
		"xenial":  "ubuntu16.04",
		"yakkety": "ubuntu16.10",
		"zesty":   "ubuntu17.04",
		"artful":  "ubuntu17.10",
		"bionic":  "ubuntu18.04",
		"cosmic":  "ubuntu18.10",
		"disco":   "ubuntu19.04",
		"eoan":    "ubuntu19.10",
		"focal":   "ubuntu20.04",
		"groovy":  "ubuntu20.10",
		"hirsute": "ubuntu21.04",
		"impish":  "ubuntu21.10",
		"jammy":   "ubuntu22.04",
		"kinetic": "ubuntu22.10",
		"noble":   "ubuntu24.04",
		"lunar":   "ubuntu23.04",

		"buster":   "debian10",
		"bullseye": "debian11",
		"bookworm": "debian12",
		"trixie":   "debian13",
		"forky":    "debian14",
	}
)

Functions

This section is empty.

Types

type Archive

type Archive struct {
	Name    string
	Distro  string
	Webpage string
	Files   []File
	Systemd []Systemd
	// list of filenames
	Postinst []string
	// required for debian dependency resolution
	Binaries       []string
	WinBinaries    []string
	Recommends     []string
	Suggests       []string
	Conflicts      []string
	Replaces       []string
	Provides       []string
	BuildDeps      []string
	RuntimeDeps    []string
	InstallScripts []InstallScript
	Description    string
}

type DebPackager

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

func NewDebPackager

func NewDebPackager(a *Archive, mp string) *DebPackager

func (*DebPackager) Package

func (d *DebPackager) Package(client *dagger.Client, c *dagger.Container, project *Spec) *dagger.Directory

type File

type File struct {
	Source   string
	Dest     string
	IsDir    bool
	Compress bool
}

func (*File) MoveStaticFile

func (f *File) MoveStaticFile(c *dagger.Container, rootdir string) *dagger.Container

type InstallScript

type InstallScript struct {
	When   PkgAction
	Script string
}

type PkgAction

type PkgAction int
const (
	PkgActionPreRemoval PkgAction = iota
	PkgActionPostRemoval
	PkgActionPostInstall
	PkgActionUpgrade
)

type PkgInstallMap

type PkgInstallMap map[PkgKind][]InstallScript

type PkgKind

type PkgKind string
const (
	PkgKindDeb PkgKind = "deb"
	PkgKindRPM PkgKind = "rpm"
	PkgKindWin PkgKind = "win"
)

type PkgKindMap

type PkgKindMap map[PkgKind][]string

type RpmPackager

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

func NewRPMPackager

func NewRPMPackager(a *Archive, mp string) *RpmPackager

func (*RpmPackager) Package

func (r *RpmPackager) Package(client *dagger.Client, c *dagger.Container, project *Spec) *dagger.Directory

type Spec

type Spec struct {
	Pkg      string `json:"package"`
	Distro   string `json:"distro"`
	Arch     string `json:"arch"`
	Repo     string `json:"repo"`
	Commit   string `json:"commit"`
	Tag      string `json:"tag"`
	Revision string `json:"revision"`
}

func (*Spec) Basename

func (s *Spec) Basename() (string, error)

There are semantic rules on the naming of packages for both debian- and rpm- based repositories. This method will generate the basename of the package name, according to those semantic rules, based on the information in the build spec.

func (*Spec) Dir

func (s *Spec) Dir(rootDir string) string

Our pipelines have historically used opinionated filesystem layouts to place artifacts in a consistent location. This method will determine the directory structure for all path components except the basename of the artifact produced by this build spec definition. Because the base directory can be different depending on the situation, it is supplied as an argument. Use "." as the rootDir in order to use a relative path.

func (*Spec) FullPath

func (s *Spec) FullPath(rootDir string) (string, error)

This method is provided for convenience, simply combinging `.Dir()` and `.Basename()`. See the documentation for those methods for more information.

func (*Spec) NameTagRevision

func (s *Spec) NameTagRevision() string

This logic is arbitrary, but the output must be reproducible. This is used to generate filenames for artifacts.

func (*Spec) OS

func (s *Spec) OS() string

func (*Spec) StoragePath

func (spec *Spec) StoragePath() (string, error)

This function calculates the storage path for a package in the prod storage container.

type Systemd

type Systemd struct {
	Source string
	Dest   string
}

type WinPackager

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

func NewWinPackager

func NewWinPackager(a *Archive, mp string) *WinPackager

func (*WinPackager) Package

func (w *WinPackager) Package(client *dagger.Client, c *dagger.Container, project *Spec) *dagger.Directory

Jump to

Keyboard shortcuts

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