Tag: jenkins

jenkins为不同的环境建设

我目前在开发框上安装了Jenkins实例。 这种构建很好,并且可以毫无问题地部署到我们的开发环境中。 在构建过程中,我的项目使用包含诸如数据库连接URL之类的详细信息的单个属性文件(这些细节显然会根据我指向的环境而变化)。 我想知道的是,配置项目的最佳方法是什么,以便当我想发布到Production时,Jenkins构建的WAR文件包含Production属性而不是Development? (注意我也在我的项目中使用Maven)。

Jenkins如何查找给定的奴隶是否正在运行作业

我有这个独特的要求来检查给定节点是否正在运行作业。 我正在考虑使用groovy,因为它看起来最简单。 我发现这个答案很有用。 如何通过Jenkins中的脚本或插件检查从属是否在线,然后再从其他项目开始构建 它允许我查找从站是否在线。 我的下一步是检查它是否正在运行一个作业。 我正在考虑使用API函数setAcceptingTasks(false)将slave标记为运行Job,这样当我下次使用isAcceptingTasks()查询时,我得到false,因此不会在该slave上启动作业。 但我宁愿拥有奴隶标记本身。 想到了taskAccepted()和taskCompleted() 。 一旦接受任务,我就可以将setAcceptingTasks调用为false,并且在完成任务后再次将isAcceptingTasks设置为true。 但我不确定这些函数的参数,例如执行器和任务。 这些函数调用在哪里适合groovy脚本。 我不确定我的任务假设是否等同于工作是否属实。 这就是我现在所拥有的: import hudson.model.* def requiredNodes = [‘Slave1’, ‘Slave2’, ‘Slave3’]; def status = 0; for (node in requiredNodes) { println “Searching for $node”; slave = Hudson.instance.slaves.find({it.name == node}); if (slave != null) { computer = slave.getComputer(); if (computer.isOffline()) { println “Error! $node […]

将变量从jenkins传递给testng.xml

我想根据从jenkins传递的变量运行测试用例,例如,选择要运行的测试用例:testcaseOne,testcaseTwo 在pom.xml(maven)中: org.apache.maven.plugins maven-surefire-plugin 2.18.1 testng.xml ${chooseCase} <–this dont work tests 10 我有两个testng @test方法: @Test(groups=”caseOne”) @Test(groups=”caseTwo”) 我的testng.xml文件: 如何传递此参数取决于我想要运行的测试数量和数量? 也许有完全不同的方式来做到这一点?

Android Emulator插件无法在Jenkins中运行

当我使用选项创建模拟器在Jenkins上运行测试时,我遇到了这个问题: [android]无法创建Android模拟器:无法运行AVD创建命令 当我定位现有的模拟器时,我遇到了这个问题: 致命:C:\ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini(系统找不到指定的路径)java.io.FileNotFoundException:C:\ Windows \ system32 \ config \ systemprofile.android \ avd \ AVD_2.2.ini(系统找不到指定的路径)java.io.FileInputStream.open(本机方法)java.io.FileInputStream。(未知来源)java.io.FileReader。(未知来源)在hudson.plugins.andol_mulator上的hudson.plugins.android_emulator.util.Utils.parseConfigFile(Utils.java:436)hudson.plugins .android_emulator.SdkInstaller $ 2.call(SdkInstaller.java:331)hdson.plugins .android_emulator.SdkInstaller $ 2.call(SdkInstaller) .java:328)位于hudson.plugins.andinCalgins上的hudson.plugins.android_emulator.SdkInstaller.getPlatformFromExistingEmulator(SdkInstaller.java:328)中的hudson.remoting.LocalChannel.call(LocalChannel.java:45)(SdkInstaller。) java:312)在hudson.plugins.android_emulato的hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:174) r.AndroidEmulator.setUp(AndroidEmulator.java:247)at hudson.model.Build $ BuildExecution.doRun(Build.java:154)at hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:499)at hudson.model .run.execute(Run.java:1488)位于hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)hudson.model.ResourceController.execute(ResourceController.java:88)hudson.model.Executor.run( Executor.java:236) 我有这个文件。 当我运行手动模拟器和jenkins测试它的工作原理。

Jenkins可以构建Eclipse项目吗?

我以为我读过Jenkins支持与Eclipse集成来构建Eclipse项目的地方,但现在我找不到任何支持这个的文档。 这有可能做到,还是我咆哮错了树?

Jenkins hudson.util.IOException2:远程文件操作失败

我正在使用CentOS 5和Jenkins 1.430。 当我尝试构建时,我收到一个错误: hudson.util.IOException2: remote file operation failed: /home/build/jenkins/workspace/tests at hudson.remoting.Channel@6c89db9a:build-test at hudson.FilePath.act(FilePath.java:754) at hudson.FilePath.act(FilePath.java:740) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:705) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:654) at hudson.model.AbstractProject.checkout(AbstractProject.java:1193) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:566) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:454) at hudson.model.Run.run(Run.java:1376) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:230) Caused by: java.io.IOException: Remote call on build-test failed at hudson.remoting.Channel.call(Channel.java:690) at hudson.FilePath.act(FilePath.java:747) … 10 more Caused by: java.lang.NoClassDefFoundError: Could not initialize […]

在Jenkins上通过Java Web Start启动从属代理时出现问题

我们最近将Jenkins升级到最新版本。 从那时起,每当我尝试启动它时,我都无法通过命令行通过Java WebStart启动从属设备我得到“无法启动应用程序”错误 在详细信息面板中使用此function CouldNotLoadArgumentException[ Could not load file/URL specified: http://MyServer:8080/computer/Slave1/slave-agent.jnlp] at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main.access$000(Unknown Source) at com.sun.javaws.Main$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 当尝试浏览到Jenkins站点并从那里进行午餐时,IT WORKS然后如果您重新启动该框,则启动时的命令行无法完成该任务。 这是我试图从奴隶运行的命令 cd “C:\Program Files (x86)\Java\jre7\bin” javaws http://MyServer:8080/computer/Slave1/slave-agent.jnlp 问题是这曾经起作用了。 我也尝试更新到最新版本的Java,但没有运气, 任何想法有人吗?

Maven / Jenkins java.lang.UnsupportedClassVersionError:不支持的major.minor版本51.0

我有一台安装了JDK&JRE 6和7的Jenkins服务器。 所有项目都建立在1.6上,除了1.7依赖项目。 我已经将maven pom文件配置为使用JAVA_HOME_7环境PATH中的Java编译器。 org.apache.maven.plugins maven-compiler-plugin 3.0 1.7 1.7 true true **${env.JAVA_HOME_7}/bin/javac** true false 在mvn安装期间,我收到以下错误: java.lang.RuntimeException: There was an error in the forked process java.lang.UnsupportedClassVersionError: : Unsupported major.minor version 51.0 我认为这意味着服务器正在使用JRE 1.6。 如何将JRE 1.6与1.7保持在一起以保持与旧1.6项目和新1.7项目的兼容性? 非常感谢,Atanas

如何在每个Slave节点的Jenkins中配置Maven安装?

症状 如果我在Jenkins( New Item => Maven项目 )中使用所有默认值创建Maven作业并运行它,我会收到此错误: Started by user anonymous Building on master in workspace /var/lib/jenkins/jobs/job_name/workspace ERROR: A Maven installation needs to be available for this project to be built.Either your server has no Maven installations defined, or the requested Maven version does not exist. Finished: FAILURE Maven从命令行运行完美,只需要mvn 。 不可接受的解决方法 Maven安装有一个系统范围的Jenkins配置: Manage Jenkins => […]

Jackson Databind类路径问题

我有一个弹簧启动应用程序,当我在我的本地使用“mvn clean install”进行部署时工作正常,但是当通过Jenkin生成战争时,它会抛出以下错误。 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘objectMapper’ defined in class path resource [com/test/common/TestRestConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Factory method ‘objectMapper’ threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.fasterxml.jackson.databind.SerializationConfig at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at […]