Documentation
¶
Index ¶
- type Binary
- type Boost
- type Docker
- type Platform
- type Platforms
- type Project
- type Registries
- type Registry
- type Target
- func (t *Target) AllPlatforms() (platforms Platforms)
- func (t *Target) AllRegistries() (registries []*Registry)
- func (t *Target) BuildWithPush(registries *Registries, docker *Docker) bool
- func (t *Target) Dir() (context string)
- func (t *Target) PlatformArgument() (argument string)
- func (t *Target) Qemu() (qemu bool)
- func (t *Target) Tags(registries *Registries, docker *Docker) (tags []string)
- type Targets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Docker ¶
type Docker struct { // 主机 Host string `default:"${HOST=/var/run/docker.sock}" json:"host,omitempty" validate:"required"` // 端口 Port uint `default:"${PORT}" json:"port,omitempty" validate:"max=65535"` // 协议 Protocol string `default:"${PROTOCOL=${PROTO=unix}}" json:"protocol,omitempty" validate:"oneof=ssh tcp unix"` // 用户名 // 因为USERNAME环境变量在Docker镜像里面已经被使用 // 所以先用USER环境变量去接收参数 // 如果USER没设置而USERNAME被设置,那么接收到的值是正确的,因为环境变量是可以被覆盖的 Username string `default:"${USER=${USERNAME}}" json:"username,omitempty" validate:"required_if=Protocol ssh"` // 密码 Password string `default:"${PASSWORD}" json:"password,omitempty" validate:"required_if=Protocol ssh Key ''"` // 密钥 Key string `default:"${KEY}" json:"key,omitempty" validate:"required_if=Protocol ssh Password ''"` // 启动成功后的标志 Mark string `default:"${MARK=API listen on /var/run/docker.sock}" json:"mark,omitempty"` // 镜像列表 Mirrors []string `default:"${MIRRORS}" json:"mirrors,omitempty"` // 启用实验性功能 Experimental bool `default:"${EXPERIMENTAL=true}" json:"experimental,omitempty"` // 精减镜像层数 Squash bool `default:"${SQUASH=true}" json:"squash,omitempty"` // 压缩镜像 Compress bool `default:"${COMPRESS=true}" json:"compress,omitempty"` // 标签列表 Labels []string `default:"${LABELS}" json:"labels,omitempty"` // 数据目录 Data string `default:"${DATA=/var/lib/docker}" json:"data,omitempty"` // 驱动 Driver string `default:"${DRIVER}" json:"driver,omitempty"` // 仓库 Repository string `default:"${REPOSITORY}" json:"repository,omitempty"` }
type Platform ¶
type Platform struct { // 操作系统 Os string `default:"${OS=linux}" json:"os,omitempty" validate:"omitempty,oneof=linux windows"` // 架构 Arch string `default:"${ARCH=amd64}" json:"arch,omitempty" validate:"omitempty,oneof=amd64 i386 arm arm64"` // 变体 // nolint:lll Variant string `default:"${VARIANT}" json:"variant,omitempty" validate:"omitempty,required_if=Arch arm,oneof=v5 v6 v7"` }
type Project ¶
type Project struct { // 仓库地址 Remote string `default:"${REMOTE=${DRONE_REMOTE_URL=https://github.com/dronestock/docker}}" json:"remote,omitempty"` // 镜像链接 // nolint:lll Link string `default:"${LINK=${PLUGIN_REPO_LINK=${DRONE_REPO_LINK=https://github.com/dronestock/docker}}}" json:"link,omitempty"` }
type Registries ¶
type Registries []*Registry
type Registry ¶
type Registry struct { // 仓库地址 Hostname string `default:"docker.io" json:"hostname,omitempty" validate:"required,hostname"` // 用户名 Username string `json:"username,omitempty"` // 密码 Password string `json:"password,omitempty"` // 登录成功标志 Mark string `default:"Login Succeeded" json:"mark,omitempty"` Name string `default:"未设置" json:"name,omitempty"` }
type Target ¶
type Target struct { Platform `default:"${PLATFORM}"` // 平台 // 配置文件 Dockerfile string `default:"${DOCKERFILE=Dockerfile}" json:"dockerfile,omitempty" validate:"required"` // 上下文 Context string `default:"${CONTEXT=.}" json:"context,omitempty"` // 标签 Tag string `default:"${TAG=${DRONE_TAG=0.0.${DRONE_BUILD_NUMBER}}}" json:"tag,omitempty" validate:"required"` // 前缀 Prefix string `default:"${PREFIX}" json:"prefix,omitempty"` // 中间 Middle string `default:"${MIDDLE}" json:"middle,omitempty"` // 后缀 Suffix string `default:"${SUFFIX}" json:"suffix,omitempty"` // 自动标签 Auto bool `default:"${AUTO=true}" json:"auto,omitempty"` // 名称 Name string `default:"${NAME=${DRONE_COMMIT_SHA=latest}}" json:"name,omitempty"` // 平台列表 Platforms Platforms `default:"${PLATFORMS}" json:"platforms,omitempty"` // 仓库 Registry *Registry `json:"registry,omitempty"` // 仓库列表 Registries []*Registry `json:"registries,omitempty"` }
func (*Target) AllPlatforms ¶
func (*Target) AllRegistries ¶
func (*Target) BuildWithPush ¶
func (t *Target) BuildWithPush(registries *Registries, docker *Docker) bool
func (*Target) PlatformArgument ¶
type Targets ¶
type Targets []*Target
func (*Targets) BinfmtNeedSetup ¶
func (*Targets) DriverNeedSetup ¶
func (*Targets) Registries ¶
func (t *Targets) Registries() (registries Registries)
Click to show internal directories.
Click to hide internal directories.