概括:
我有几个像 GigaProject 这样的项目。他们都有一个 build.gradle 文件,现在包含以下行,专门用于单元测试的 PMD、CheckStyle、FindBugs 和 Jacoco 代码覆盖率。一切正常。当我运行“gradle clean build”时,项目编译成功并向我显示代码覆盖率报告(jacoco)和 findbugs/checkstyle/pmd 报告。
PNote:我提到过,我没有在此处列出其他用于构建/编译的代码。以下代码只是让 pmd/findbugs/checkstyle 和 Jacoco 功能正常工作的补充。
allprojects {
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'code-quality'
apply plugin: 'jacoco'
tasks.withType(Compile) {
options.debug = true
options.compilerArgs = ["-g"]
}
checkstyle {
configFile = new File(rootDir, "config/checkstyle.xml")
ignoreFailures = true
}
findbugs {
ignoreFailures = true
}
pmd {
ruleSets = ["basic", "braces", "design"]
ignoreFailures = true …Run Code Online (Sandbox Code Playgroud) 我有 CentOS 6.5
我正在尝试通过 yum 安装git,但在安装必备软件包时出错。我不需要,但使用 root 运行 sudo 并没有什么坏处。
错误信息:
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. …Run Code Online (Sandbox Code Playgroud) 想知道 Jenkins 内部版本号 (BUILD_NUMBER) 可以获得的最大数量是多少?我试图在网上查找但找不到此信息。
它是无限的还是有一些限制(INT 或 INT64 或其他类型)?
PS: 我不是在寻找如何使用以下插件将其重置回 #1 或 #N 或将其值设置为给定名称(使用 Set build name 插件)。 https://wiki.jenkins-ci.org/display/JENKINS/Next+Build+Number+Plugin
为了找到它的限制,使用下一个版本号插件- 当我将版本设置为“65,535”时,它仍然可以成功地让我获得 65536,并且我不断将该值增加到 999999999(9 次),并且它仍然有效,即下一个版本运行了 1000000000 次,并为其他几个运行/构建获得了有效的 Jenkins 构建#。
当我尝试将下一个版本号设置为:9999999999(10次)时,Jenkins插件抛出错误消息(显示我设置的下一个版本号不是整数,即不在范围内):
A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you …Run Code Online (Sandbox Code Playgroud) ansible/ansible-playbook 版本:2.1.2.0 / 2.2.0.0
我正在尝试使用 yum/apt 安装软件包,但由于安装软件包的存储库位于 packagecloud.io 中,有时我会收到一条错误消息(当我在运行-vvvansible-playbook 时通过时)。
[Errno 14] curl#56 - \"TCP connection reset by peer\"\nTrying other mirror. ...some ansible verbose text here.. [Errno 256] No more mirrors to try.
Run Code Online (Sandbox Code Playgroud)
这种情况并不总是发生。如果我再次重新运行相同的剧本,它工作正常,因此失败(连接重置)是随机发生的。
为了解决这个问题,我想使用 Ansible 的until循环,我们必须将其与register变量一起使用。
因此,我通过引用 Ansible 文档创建了这个 playbook 操作,了解如何在此处until使用循环,但是使用该语法我收到一个“字典”错误,指出结果变量(注册) dict 没有任何名为stdout的键。然后我尝试使用 result.rc (关键字段),它在 CentOS 机器上工作,但在 Ubuntu 14.x 可信赖的 vagrant 机器上失败,并出现以下 result.rc dict not present 错误:
- name: Install telegraf agent/collector (RedHat)
yum:
name: "{{ agent_collector }}" …Run Code Online (Sandbox Code Playgroud) 使用 Python 2.7.10,我有这个脚本:
#!/usr/bin/python
#Do `sudo pip install boto3` first
import boto3
import json
def generate(key, value):
"""
Creates a nicely formatted Key(Value) item for output
"""
return '{}={}'.format(key, value)
def main():
ec2 = boto3.resource('ec2', region_name="us-west-2")
volumes = ec2.volumes.all()
for vol in volumes:
#print(vol.__str__())
#print(vol.__dict__)
print vol
# vol object has many attributes, which can be another class object.
# For ex:
#vol.volume_id),
#vol.availability_zone),
#vol.volume_type),
# only process when there are tags to process
# HERE: tags is another object …Run Code Online (Sandbox Code Playgroud) 操作系统: Ubuntu 14.04
nginx: nginx 版本:nginx/1.4.6 (Ubuntu)
为了在浏览器端为框架提供基于点击劫持的安全性,X-Frame-Options可以通过 3 种不同的方式设置标头选项。
DENYSAMEORIGINALLOW-FROM <uri>PS:https: //www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet(兼容性矩阵)和https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options(笔记:不要将 Apache 与 Nginx 混合用于配置部分)。
我想在我的 Jenkins 机器上(即 Jenkins 作业的仪表板上)启用框架/ iframe (由日志解析器插件生成/提供)的显示。有关更多信息,您可以在此处查看一些背景:Jenkins Log parser plugin - parsed console log page is not shown Load returned by X-Frame-Options does not allowed framing ERR_BLOCKED_BY_RESPONSE
为此,我需要确保以下几行不存在于我的 jenkins https conf 文件 / 的 NGINX 配置中,或者您可以将其注释掉。
add_header X-Frame-Options DENY;
Run Code Online (Sandbox Code Playgroud)
注释此行,框架现在将在浏览器中(即作业的仪表板上)呈现良好,但这样做会带来安全问题。
要实现第二个选项,请确保删除/替换上面的行,或者确保 Jenkins https conf 的 NGINX 配置文件中存在以下行。 …
我有一个jenkins master和一个单独的slave服务器.我使用swarm插件将slave连接到master.在配置LDAP认证并撤消匿名用户授权之前,一切正常.
显然现在我必须验证swarm客户端,但我无法做到这一点.如果有人有swarm插件的经验,请告诉我.
从机的控制台:
$ java -jar swarm-client-2-0.jar -master http://x.x.x.x:8080/ -username 'exxxx' -password common.pwd
Discovering Jenkins master
Oct 01, 2015 2:14:51 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
Oct 01, 2015 2:14:51 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge
INFO: Failure authenticating with BASIC 'Jenkins'@x.x.x.x:8080
Failed to fetch slave info from Jenkins CODE: 401
Retrying in 10 seconds
Run Code Online (Sandbox Code Playgroud)
BR,
我正在使用Jenkins(1.573)和Swarm插件(2.0):https : //wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin。
从http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/2.0/下载了jar
我已经在Jenkins(主机)中安装了插件,并且从其中一台Linux机器(我想用作从机)中下载了具有依赖项2.0的swarm客户端jar并运行了以下命令:
注意:
$ p变量中存储了密码。
可以正常使用模式(而不是独占模式)。
$ java -jar swarm-client-2.0-jar-with-dependencies.jar -name“`hostname -a`_01” -fsroot“`pwd` /`hostname -a`_01” -master http://jenkins_server.yo .company.com:8081 -disableSslVerification-用户名c123456-密码$ p-说明“主机名-a”-执行程序5-标签“ ANSIBLE_CENTOS CENTOS”-模式“独占”-重试3
Discovering Jenkins master
Dec 03, 2015 3:52:58 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
Attempting to connect to http://jenkins_server.yo.company.com:8081/ 1229493c-3bd5-4cf4-9210-3392089f2ee2 with ID 1893f0ea
Could not obtain CSRF crumb. Response code: 404
Dec 03, 2015 3:53:01 PM hudson.remoting.jnlp.Main createEngine …Run Code Online (Sandbox Code Playgroud) 如何从文件权限中删除"@"字符?
Mac/OSX计算机的文件权限中的" @ "用于显示使用此文件设置扩展属性.
chmod 755 galaxy-ansible.yml但没有帮助.echo | chmod -E galaxy-ansible.yml,没有帮助(即使使用sudo).xattr -d galaxy-ansible.yml,这也没有帮助(即使使用sudo).我甚至以root用户身份执行了上述操作,仍然是'@'字符不会远离文件的权限.
[arun@MacBook-Pro-2 ~/aks/anisble] $ ls -l@ galaxy-ansible.yml
-rwxr-xr-x@ 1 arun staff 270 Dec 22 12:31 galaxy-ansible.yml
com.apple.quarantine 67
Run Code Online (Sandbox Code Playgroud)
我的〜/ aks文件夹被映射到CentOS流浪者盒子,如果我在流浪盒上,ls -l那么就不会给我'@'(因为它不是Max/OSX机器):
-rwxr-xr-x. 1 vagrant vagrant 270 Dec 22 00:12 galaxy-ansible.yml
Run Code Online (Sandbox Code Playgroud)
在我的Mac/OSX机器上,还有其他.yml文件,但那些文件权限中没有'@',所以我试图从galaxy-ansible.yml文件中删除'@'(在Mac机器上).
现在整个角色/ ..文件夹的任何文件夹/文件都有'@'字符.
-rwxr-xr-x@ 1 arun staff 1132 Dec 21 17:12 README.md
drwxr-xr-x@ 3 arun staff 102 Dec 21 17:12 defaults …Run Code Online (Sandbox Code Playgroud) 我在 Mac 机器上。
$ which ansible
/Library/Frameworks/Python.framework/Versions/3.5/bin/ansible
Run Code Online (Sandbox Code Playgroud)
或者我猜,ansible可以位于通用位置:(/usr/bin/ansible例如:在 CentOS/Ubuntu 上)。
$ ansible --version
ansible 2.2.0.0
Run Code Online (Sandbox Code Playgroud)
在我的另一个 vagrant / Ubuntu 机器上运行以下 playbook 效果很好。
Playbook 文件如下所示:
- hosts: all
become: true
gather_facts: true
roles:
- a_role_which_just_say_hello_world_debug_msg
Run Code Online (Sandbox Code Playgroud)
从我的本地计算机,我可以成功ssh访问目标服务器/以下服务器(无需任何密码,因为我已经使用添加了 .pem 密钥文件ssh-add),这在 Ansible playbook 运行中的 Ansible playbook [Setup] (收集事实步骤)中失败。
在 Mac 机器上,我有时(不是每次)都会收到此错误。错误:Failed to connect to the host via ssh: Connection timed out during banner exchange。PS:这个问题不会一直出现。
$ ansible-playbook -i inventory -l tag_cluster_mycluster myplabook.yml
PLAY [all] ********************************************************************* …Run Code Online (Sandbox Code Playgroud) jenkins ×3
ansible ×2
ansible-2.x ×2
amazon-ec2 ×1
centos6 ×1
centos6.5 ×1
chmod ×1
darwin ×1
dependencies ×1
docker-swarm ×1
file ×1
frames ×1
global ×1
gradle ×1
iframe ×1
integer ×1
jacoco ×1
libselinux ×1
linux ×1
macos ×1
master-slave ×1
nginx ×1
object ×1
python ×1
python-2.7 ×1
range ×1
recursion ×1
server ×1
slave ×1
ssh ×1
stdout ×1
testing ×1
yum ×1