我可以通过Jenkins Web GUI创建一个新节点,然后让一个容器中的节点通过名称和-secret值连接回Jenkins主机
恩.
docker run jenkinsci/jnlp-slave -url http://jenkins-server:port <secret> <slave name>
有没有办法以编程方式创建一个Jenkins节点并获取秘密和从属名称,所以我不必通过GUI来完成它?
我有一个正则表达式,已在一些在线正则表达式解析器中验证过
^(.*\.(?!(htm|html|class|js)$))?[^.]
Run Code Online (Sandbox Code Playgroud)
在 golang 中实现这一点与在线正则表达式解析器的方式不匹配
package main
import (
"fmt"
"regexp"
"strconv"
)
type ParsedConfigFile struct {
prefix string
instanceNum int
extension string
}
// tries to guess config type and instance id from files
func parseFiles(files []string) {
re := regexp.MustCompile(`(type1|type2)_(\d+)\.(csv|ini)`)
var matchedFiles []ParsedConfigFile
for _, file := range files {
match := re.FindStringSubmatch(file)
// we have 3 groups we try to capture in the regex + 1 for the full match
EXPECTED_MATCH_COUNT := 4
if len(match) == …Run Code Online (Sandbox Code Playgroud)