当前位置: 首页>>代码示例>>Golang>>正文


Golang ContainerNode.Disabled方法代码示例

本文整理汇总了Golang中github.com/drone/drone/engine/compiler/parse.ContainerNode.Disabled方法的典型用法代码示例。如果您正苦于以下问题:Golang ContainerNode.Disabled方法的具体用法?Golang ContainerNode.Disabled怎么用?Golang ContainerNode.Disabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/drone/drone/engine/compiler/parse.ContainerNode的用法示例。


在下文中一共展示了ContainerNode.Disabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: visitMatrix

func (v *filterOp) visitMatrix(node *parse.ContainerNode) {
	for key, val := range node.Conditions.Matrix {
		if v.matrix[key] != val {
			node.Disabled = true
			break
		}
	}
}
开发者ID:tnaoto,项目名称:drone,代码行数:8,代码来源:filter.go

示例2: visitEvent

// visitEvent is a helper function that disables container steps
// when the build event conditions are not satisfied.
func (v *filterOp) visitEvent(node *parse.ContainerNode) {
	if len(node.Conditions.Event) == 0 {
		return
	}
	for _, pattern := range node.Conditions.Event {
		if ok, _ := filepath.Match(pattern, v.event); ok {
			return
		}
	}
	node.Disabled = true
}
开发者ID:tnaoto,项目名称:drone,代码行数:13,代码来源:filter.go

示例3: visitPlatform

// visitPlatform is a helper function that disables container steps
// when the build event conditions are not satisfied.
func (v *filterOp) visitPlatform(node *parse.ContainerNode) {
	if len(node.Conditions.Platform) == 0 {
		return
	}
	for _, pattern := range node.Conditions.Platform {
		if ok, _ := filepath.Match(pattern, v.platform); ok {
			return
		}
	}
	node.Disabled = true
}
开发者ID:tnaoto,项目名称:drone,代码行数:13,代码来源:filter.go

示例4: VisitContainer

func (v *cacheOp) VisitContainer(node *parse.ContainerNode) error {
	if node.Type() != parse.NodeCache {
		return nil
	}
	if len(node.Vargs) == 0 || v.enable == false {
		node.Disabled = true
		return nil
	}

	if node.Container.Name == "" {
		node.Container.Name = "cache"
	}
	if node.Container.Image == "" {
		node.Container.Image = v.plugin
	}

	// discard any other cache properties except the image name.
	// everything else is discard for security reasons.
	node.Container = runner.Container{
		Name:  node.Container.Name,
		Alias: node.Container.Alias,
		Image: node.Container.Image,
		Volumes: []string{
			v.mount + ":/cache",
		},
	}

	// this is a hack until I can come up with a better solution.
	// this copies the clone name, and appends at the end of the
	// build. When it is executed a second time the build should
	// have a completed status, so it knows to cache instead
	// of restore.
	cache := node.Root().NewCacheNode()
	cache.Vargs = node.Vargs
	cache.Container = node.Container
	node.Root().Script = append(node.Root().Script, cache)
	return nil
}
开发者ID:tnaoto,项目名称:drone,代码行数:38,代码来源:cache.go

示例5: VisitContainer

func (v *cloneOp) VisitContainer(node *parse.ContainerNode) error {
	if node.Type() != parse.NodeClone {
		return nil
	}
	if v.enable == false {
		node.Disabled = true
		return nil
	}

	if node.Container.Name == "" {
		node.Container.Name = "clone"
	}
	if node.Container.Image == "" {
		node.Container.Image = v.plugin
	}

	// discard any other cache properties except the image name.
	// everything else is discard for security reasons.
	node.Container = runner.Container{
		Name:  node.Container.Name,
		Image: node.Container.Image,
	}
	return nil
}
开发者ID:tnaoto,项目名称:drone,代码行数:24,代码来源:clone.go


注:本文中的github.com/drone/drone/engine/compiler/parse.ContainerNode.Disabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。