我正在设计一个新的YAML文件,我想使用最标准的命名方式.这是什么?
复姓?
- job-name:
...
Run Code Online (Sandbox Code Playgroud)
lower_case_with_underscores?
- job_name:
...
Run Code Online (Sandbox Code Playgroud)
骆驼香烟盒?
- jobName:
...
Run Code Online (Sandbox Code Playgroud) 我有一系列快速检查的阶段.即使有失败,我也想要完成它们.例如:
stage('one') {
node {
sh 'exit 0'
}
}
stage('two') {
node {
sh 'exit 1' // failure
}
}
stage('three') {
node {
sh 'exit 0'
}
}
Run Code Online (Sandbox Code Playgroud)
阶段two失败,因此默认情况下three不执行阶段.
通常这是一个工作parallel,但我想在舞台视图中显示它们.在下面的模拟中:
two失败,所以three不运行.two失败并显示为,但three仍然运行.真正的Jenkins可能会显示整个Build#6略带红色,这当然很好.如何模拟具有未绑定方法的类?例如,这个类有一个@classmethod和一个@staticmethod:
class Calculator(object):
def __init__(self, multiplier):
self._multiplier = multiplier
def multiply(self, n):
return self._multiplier * n
@classmethod
def increment(cls, n):
return n + 1
@staticmethod
def decrement(n):
return n - 1
calculator = Calculator(2)
assert calculator.multiply(3) == 6
assert calculator.increment(3) == 4
assert calculator.decrement(3) == 2
assert Calculator.increment(3) == 4
assert Calculator.decrement(3) == 2
Run Code Online (Sandbox Code Playgroud)
以上几乎描述了我的问题.以下是一个工作示例,演示了我尝试过的事情.
类Machine包含一个实例Calculator.我将Machine用模拟测试Calculator.要演示我的问题,请Machine通过类的实例Calculator和Calculator类来调用未绑定的方法:
class Machine(object):
def __init__(self, calculator):
self._calculator …Run Code Online (Sandbox Code Playgroud) 使用 Terraform 0.12,我在 S3 存储桶中创建了一个静态网站:
...
resource "aws_s3_bucket" "www" {
bucket = "example.com"
acl = "public-read"
policy = <<-POLICY
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::example.com/*"]
}]
}
POLICY
website {
index_document = "index.html"
error_document = "404.html"
}
tags = {
Environment = var.environment
Terraform = "true"
}
}
resource "aws_route53_zone" "main" {
name = "example.com"
tags = {
Environment = var.environment
Terraform = "true"
}
}
resource "aws_route53_record" "main-ns" {
zone_id …Run Code Online (Sandbox Code Playgroud) 我们正在为自己的非Android软件使用Android回购工具。我们使用的是GitLab,而不是Gerrit进行代码审查。使用GitLab,我只需要对主题分支进行普通推送,就像git push在工作区的每个存储库中一样。
如何在多个存储库上repo upload 进行普通git push设置?您可能会说我需要不存在的repo push命令。
我尝试使用<remote review />清单文件中属性的各种值来实现这一点,例如:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="wfe"
alias="origin"
review="origin"
fetch=".." />
<remote name="wcore"
alias="origin"
review="ssh://git@gitlabserver:sw/wcore"
fetch=".." />
<default revision="master"
remote="wfe"
sync-j="4" />
<project path="wcore" name="wcore" remote="wcore" groups="sdk" />
<project path="wfe" name="wfe" groups="sdk" />
</manifest>
Run Code Online (Sandbox Code Playgroud)
但是,我得到如下错误:
repo upload
----------------------------------------------------------------------
[FAILED] wcore/ repo-test
(ssh://git@gitlabserver:sw/wcore: <urlopen error [Errno 110] Connection timed out>)
[FAILED] wfe/ repo-test
(origin: <urlopen error [Errno -2] Name or service …Run Code Online (Sandbox Code Playgroud) 我在microk8s中启用了仪表板:
microk8s.enable dns dashboard
Run Code Online (Sandbox Code Playgroud)
我找到了它的IP地址:
microk8s.kubectl get all --all-namespaces
...
kube-system service/kubernetes-dashboard ClusterIP 10.152.183.212 <none> 443/TCP 24h
...
Run Code Online (Sandbox Code Playgroud)
我试图使用URL https://10.152.183.212在浏览器中显示它。我的浏览器显示错误“身份验证失败。请重试。”:
我还收到了类似的错误,“没有足够的数据来创建身份验证信息结构。”
thebranch一位同事使用创建了功能分支repo start。现在我想检查这个分支并对其进行处理。我试试这个:
repo init -u git@gitserver:manifest.git -m all.xml
repo sync
repo branches # Responds "(no branches)"
repo checkout thebranch # Responds "error: no project has branch thebranch"
Run Code Online (Sandbox Code Playgroud)
如何查看其他人开始使用的功能分支repo start?