我正在尝试使用HomeBrew v1.3.8在运行xCode v9.1的Mac OSX Serra v10.12.6上安装软件包.
安装和错误是
TS-Mac-Pro > brew install dos2unix
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
xcode-select --install
Run Code Online (Sandbox Code Playgroud)
然后我运行命令
xcode-select --install
Run Code Online (Sandbox Code Playgroud)
这表示命令行工具包不能从软件更新服务器获得.
我进入xCode,它表明安装了命令行工具.
TS-Mac-Pro > xcode-select -p
/Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感激.
西奥
运行执行 bash shell 的 Jenkins Groovy Piepline 脚本时,回显时找不到本地设置的变量。
它报告错误 -
groovy.lang.MissingPropertyException: No such property: md5Value for class: WorkflowScript
Run Code Online (Sandbox Code Playgroud)
任何想法/指针将不胜感激。
#!groovy
node {
try {
stage('Test-Echo') {
sh """
#!/usr/bin/env bash
md5Value='y'
echo 'md5Value : ${md5Value}'
"""
}
} catch (e) {
println (e.getMessage())
}
}
Run Code Online (Sandbox Code Playgroud)
是的,我尝试了这些不同的排列,都报告相同的错误。
echo 'md5Value : ${md5Value}'
echo "md5Value : ${md5Value}"
echo 'md5Value : ' ${md5Value}
echo "md5Value : " ${md5Value}
echo 'md5Value : $md5Value'
echo 'md5Value : ' $md5Value
echo "md5Value : $md5Value"
echo "md5Value …Run Code Online (Sandbox Code Playgroud) 我们有一个带有 SSL 的 Squid 代理,使用自签名证书和 ca-bundle.cert。直到最近,NPM 安装在尝试安装时才开始失败
npm --registry https://registry.npmjs.org \ --proxy http://localhost:10080 --https-proxy http://localhost:10443 \ --ddd install express
产生错误 -
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/express failed,
reason: unable to verify the first certificate
Run Code Online (Sandbox Code Playgroud)
Squid 正在 Docker 中运行,其日志显示
NONE/200 0 CONNECT registry.npmjs.org:443 - HIER_DIRECT
Run Code Online (Sandbox Code Playgroud)
任何想法或指示将不胜感激。
我将“dns_v4_first on”添加到了squid.conf中,现在NPM错误消息是
npm verb node v8.9.3
npm verb npm v5.5.1
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/express failed, reason: self signed certificate in certificate …Run Code Online (Sandbox Code Playgroud) 模板内声明了两个范围,第二个范围出现错误:
Error: render error in "APPLICATION_NAME/templates/server.yaml": template: APPLICATION_NAME/templates/server.yaml:16:17: executing "APPLICATION_NAME/templates/server.yaml" at <.Values.services.def>: can't evaluate field Values in type interface {}
Run Code Online (Sandbox Code Playgroud)
可以在此处查看导致错误的范围:
paths:
{{- range $i, $svc := .Values.services.def }}
- path: "{{ $svc.path }}-{{ $x_version }}{{ $endpointPath }}($|(/.*))"
backend:
serviceName: {{ $fullName }}-{{ $svc.name }}
servicePort: {{ $svc.port }}
{{- end }}
Run Code Online (Sandbox Code Playgroud)
这是包含两个范围的模板文件:
{{ if .Values.server.enabled -}}
{{- $fullName := include "generic.fullname" . -}}
{{- $appName := include "generic.name" . -}}
{{- $chartName := include "generic.chart" . -}}
{{- $namespace …Run Code Online (Sandbox Code Playgroud) 有没有办法以 HTTP 响应的形式自定义 Boto3 Lambda 异常消息并在发送强制失败的同时返回它?
这是一个例子
except Exception as e:
print ('\nException : failed to invoke jobs.')
print ('Error : ' + str(e) + '\n')
return {
'statusCode': 500,
'body': 'Exception : failed to invoke EMR jobs'
}
Run Code Online (Sandbox Code Playgroud)
因此,现在返回自定义消息,但 Lambda 仍返回作业成功而不是失败。
为了发送作业失败,异常块可以更改为 -
except Exception as e:
print ('\nException : failed to invoke jobs.')
print ('Error : ' + str(e) + '\n')
raise
Run Code Online (Sandbox Code Playgroud)
但是现在自定义的错误信息已经丢失了。
有没有办法组合自定义响应错误消息并使 Lambda 作业失败?
我希望从以下文本中提取以下两个字符串:
ip-10-x-x-x.eu-west-2.compute.interna
和
topology.kubernetes.io/zone=eu-west-2a
完整斑点:
ip-10-x-x-x.eu-west-2.compute.internal Ready <none> 18d v1.20.4-eks-1-20-1 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/os=linux,node.app/name=all,topology.kubernetes.io/region=eu-west-2,topology.kubernetes.io/zone=eu-west-2a
Run Code Online (Sandbox Code Playgroud)
使用带有 Grep PCRE 的正则表达式来提取字符串。
以下正则表达式适用于https://regex101.com/
(((^ip.*?)(?=(\s)))(?:.*?)((?<=\,)(topology\.kubernetes\.io\/zone.*?)(?=(\s|$))))
Run Code Online (Sandbox Code Playgroud)
但是当使用 Grep 在 Bash v4.2 上运行时,它会返回完整的 blob,而不是正则表达式组,如下所示:
echo "ip-10-x-x-x.eu-west-2.compute.internal Ready <none> 18d v1.20.4-eks-1-20-1 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/os=linux,node.app/name=all,topology.kubernetes.io/region=eu-west-2,topology.kubernetes.io/zone=eu-west-2a" | grep -oP "(((^ip.*?)(?=(\s)))(?:.*?)((?<=\,)(topology\.kubernetes\.io\/zone.*?)(?=(\s|$))))"
Run Code Online (Sandbox Code Playgroud)
我在这里缺少什么?