??xml version="1.0" encoding="utf-8" standalone="yes"?>免费视频一区二区三区在线观看,中文字幕有码在线视频,国产在线91http://www.aygfsteel.com/paulwong/category/50704.htmlzh-cnTue, 25 Jan 2022 20:21:50 GMTTue, 25 Jan 2022 20:21:50 GMT60JENKINS 部v agularjshttp://www.aygfsteel.com/paulwong/archive/2022/01/25/439385.htmlpaulwongpaulwongTue, 25 Jan 2022 03:02:00 GMThttp://www.aygfsteel.com/paulwong/archive/2022/01/25/439385.htmlhttp://www.aygfsteel.com/paulwong/comments/439385.htmlhttp://www.aygfsteel.com/paulwong/archive/2022/01/25/439385.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/439385.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/439385.html

This article assumes that you have a running Jenkins instance on your Linux machine with a valid domain (not localhost), GitLab and that you are familiar with the Angular framework.

For Jenkins, please install the GitLab and NodeJS plugins. For simplicity’s sake, this article is going to use simple shell commands to run automated tests and to deploy an app to production.

***Note. If you can’t decide where to test all this, there is an article I wrote that might help you: CI/CD Cloud Voyage with Jenkins.

Configuring Gitlab and Jenkins

Jenkins: Access Rights to GitLab

In order to use GitLab with Jenkins, you’ll need to generate an access token in GitLab, which you can do in User menu > Settings > Access tokens

and configure GitLab Connection on Jenkins by adding the newly generated token.

In Jenkins, go to Manage Jenkins > Configure system and find the GitLab section.

To add a token that you previously generated, click on Add by the Credentials input and choose Jenkins. In the credentials dialog, choose GitLab API token in the Kind input and paste your token from GitLab into the API token input field. 

Jenkins: Configure NodeJSInstaller

In order to be able to run npm scripts, it is necessary to configure NodeJSInstaller. In Jenkins, go to Manage Jenkins > Global Tool Configuration > NodeJS installations.

Jenkins: Create CI build for Angular

In order to be able to run Angular tests and check your code style in Jenkins on the created merge request in GitLab you’ll have to:

1. Click on the New item link in the Jenkins dashboard

2. Enter a job name and choose Freestyle project

3. Choose the GitLab Connection that we’ve just created in the Gitlab Connection section.

4. Choose Git as your source code management. Enter your repository URL. Create new credentials on Jenkins. These credentials are for cloning the project. You use them to log in to Gitlab.

5. Next, configure build triggers, i.e. on which GitLab event to run a build. In this particular example, angular-ci-build is going to trigger when a new merge request gets created.

In this step, we need to go back to GitLab and create a hook that will trigger this build under Settings > Integrations. Copy the URL provided by Jenkins and paste it into the project hook form and finally click Add webhook.

6. Provide the configured NodeJsInstaller in the global configuration to be able to run npm commands.

7. And finally, in the Build section choose Add build step > Execute shell. Write shell scripts to test the Angular app code and run tests.

Click Save and we are good to go. At this point everything should work.

When you create a new merge request, GitLab should trigger angular-ci-build on Jenkins and you should see status pending on that particular merge request page.

When Jenkins is done, the status on GitLab should automatically be updated. Depending on whether the build passed or not, the merge button will change color.

Jenkins: Create CD Build for Angular

In order to be able to deploy Angular to another Linux machine, we need to:

Repeat steps 1–4 from Jenkins: Create CI Build for Angular, changing only the name of the build. This time, it can be angular-deploy. 

5. For step five, we now choose a different configuration for deployment. We are going to run this build when a merge request gets accepted.

Just like for the CI build, we have to create a new GitLab hook that will hit the Jenkins build endpoint.

6. This step is also the same as in CI; we need to provide the NodeJSInstaller we already configured globally.

7. This step is different from CI; this time we don’t have to test and check linting, but only build the application and copy-paste it to another machine with ssh.

If we are going to do it with ssh like in the example, we need to create a private and public key pair for the Jenkins user on the machine Jenkins is running on. The private key needs to stay on the Jenkins machine, and the public key needs to be copied to the remote machine.

With the scp command we simply copy our build to the remote machine. In this case, Jenkins does not have permission to put it anywhere but in the user folder. In the last step, we need to ssh into the remote machine and move our files (in this case to /var/www/html).

Voila, our app is deployed to the production server when the merge request is accepted via Jenkins.

Angular: Karma Unit Test Runner Configuration

To run Angular tests on Jenkins, we need to configure some parts of the karma.conf file. Below is the configuration that adds a custom launcher that runs ChromeHeadles.

module.exports = function(config) {   config.set({     basePath: "",     frameworks: ["jasmine", "@angular-devkit/build-angular"],     plugins: [       require("karma-jasmine"),       require("karma-chrome-launcher"),       require("karma-jasmine-html-reporter"),       require("karma-coverage-istanbul-reporter"),       require("@angular-devkit/build-angular/plugins/karma")     ],     client: {       clearContext: false // leave Jasmine Spec Runner output visible in browser     },     coverageIstanbulReporter: {       dir: require("path").join(__dirname, "../coverage/jenkins-test-app"),       reports: ["html", "lcovonly", "text-summary"],       fixWebpackSourcePaths: true     },     reporters: ["progress", "kjhtml"],     port: 9876,     colors: true,     logLevel: config.LOG_INFO,     autoWatch: true,     browsers: ["Chrome", "ChromeHeadless"],     singleRun: false,     restartOnFileChange: true,     customLaunchers: {       ChromeHeadless: {         base: "Chrome",         flags: [           "--headless",           "--disable-gpu",           "--no-sandbox",           "--remote-debugging-port=9222"         ],                },     }   }); };

We can then simply store our command in the package.json scripts property.

On Jenkins, we would now run our tests with npm run test:ci.

 "scripts": {     "ng": "ng",     "start": "ng serve",     "build": "ng build",     "test": "ng test",     "test:ci": "ng test --browsers=ChromeHeadless --watch=false",     "lint": "ng lint",     "e2e": "ng e2e"   },

I hope you enjoyed this article and that it was helpful in your quest for automating angular deployment and testing.



paulwong 2022-01-25 11:02 发表评论
]]>
Jenkins environment variableshttp://www.aygfsteel.com/paulwong/archive/2021/08/16/435944.htmlpaulwongpaulwongMon, 16 Aug 2021 07:46:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/08/16/435944.htmlhttp://www.aygfsteel.com/paulwong/comments/435944.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/08/16/435944.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435944.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435944.htmlhttps://medium.com/@mukeshsingal/access-jenkins-global-environment-variables-using-groovy-or-java-b5c1e6b53685



paulwong 2021-08-16 15:46 发表评论
]]>
【DevOps】JenkinsdZTagq行构徏http://www.aygfsteel.com/paulwong/archive/2021/04/22/435862.htmlpaulwongpaulwongThu, 22 Apr 2021 03:00:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/04/22/435862.htmlhttp://www.aygfsteel.com/paulwong/comments/435862.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/04/22/435862.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435862.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435862.html https://blog.csdn.net/justyman/article/details/89857577

如果是自动触发B(ti)UILDӞ则可以以最新徏立的TAG为基q行BUILDQ而无需人手选TAGq行BUILD?br /> 配置Q注意应取消参数化配|工E:(x)
  1. Add the following refspec to the Git plugin:
    +refs/tags/*:refs/remotes/origin/tags/*
  2. Add the following branch specifier:
    */tags/*
  3. Enable SCM polling, so that the job detects new tags.


paulwong 2021-04-22 11:00 发表评论
]]>
如何在JENKINS中用HTTP下蝲 NEXUS上的ZIPhttp://www.aygfsteel.com/paulwong/archive/2020/07/31/435624.htmlpaulwongpaulwongFri, 31 Jul 2020 12:18:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/07/31/435624.htmlhttp://www.aygfsteel.com/paulwong/comments/435624.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/07/31/435624.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435624.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435624.htmlFile Operations

d如下STEPQFile Download Operation

NEXUS上的下蝲地址按如下模式:(x)http://localhost:8081/service/rest/v1/search/assets/download?group=org.osgi&name=org.osgi.core&version=4.3.1&maven.extension=jar&maven.classifier



paulwong 2020-07-31 20:18 发表评论
]]>
JENKINS TOURIALhttp://www.aygfsteel.com/paulwong/archive/2020/04/07/435324.htmlpaulwongpaulwongTue, 07 Apr 2020 02:29:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/04/07/435324.htmlhttp://www.aygfsteel.com/paulwong/comments/435324.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/04/07/435324.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435324.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435324.htmlhttps://huongdanjava.com/jenkins-2



paulwong 2020-04-07 10:29 发表评论
]]>
windows下jenkins提示文g名太?/title><link>http://www.aygfsteel.com/paulwong/archive/2020/02/14/435104.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Fri, 14 Feb 2020 06:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2020/02/14/435104.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/435104.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2020/02/14/435104.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/435104.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/435104.html</trackback:ping><description><![CDATA[<div>׃jenkins是调用windows的git取代码,因此是git的问题,q行如下配置卛_Q?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->git config --global core.longpaths true</div><br /></div><img src ="http://www.aygfsteel.com/paulwong/aggbug/435104.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2020-02-14 14:37 <a href="http://www.aygfsteel.com/paulwong/archive/2020/02/14/435104.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用 Jenkins 部v Spring Boothttp://www.aygfsteel.com/paulwong/archive/2019/09/19/434675.htmlpaulwongpaulwongThu, 19 Sep 2019 09:44:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/09/19/434675.htmlhttp://www.aygfsteel.com/paulwong/comments/434675.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/09/19/434675.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/434675.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/434675.htmlhttps://mp.weixin.qq.com/s?__biz=MzI4NDY5Mjc1Mg==&mid=2247489278&idx=2&sn=a48342d706bfd1651e277e1c24e81e3e&chksm=ebf6ce81dc81479764d1e6ff7b207257a78d52bed5ef8c2f16c76f70660d1da9609167ed7bbb&mpshare=1&scene=1&srcid=&sharer_sharetime=1568861026830&sharer_shareid=24856bf403968a883e437b859be0a9b5&pass_ticket=qB9yWQbj%2FGo7PDZNogjBwishDCx5Suu%2BvBWnS1TpKmY%3D#rd

paulwong 2019-09-19 17:44 发表评论
]]>
publish over ssh 实现 Jenkins q程部vhttp://www.aygfsteel.com/paulwong/archive/2019/07/25/434296.htmlpaulwongpaulwongThu, 25 Jul 2019 01:33:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/07/25/434296.htmlhttp://www.aygfsteel.com/paulwong/comments/434296.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/07/25/434296.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/434296.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/434296.htmlJenkinsq程部vQ一开始没有Q何头l,想了很多Ҏ(gu). 因ؓ(f)两台机器都是windowspȝQ所以想到publish over cifs, 但是q个|上资料太少Q貌似只能内|用。又惛_了Jenkins 分布式构建,但是Jenkins构徏的代码和产物最后自动拷贝到主节炏V而远E机器其实是客户方的机器Q所以这个分布式构徏q不适用。最后还是选定publish over ssh来实现远E部|Ӏ?nbsp;
h意:(x)在进行远E部|操作前Q先要确保客h能ssh d到远E机器。如果不知道SSH怎么登陆Q请参考http://blog.csdn.net/flyingshuai/article/details/72897692 
1. 安装publish over ssh 插gQ安装很单,在此不表?nbsp;
2. 在Jenkinspȝ讄里找到Publish over SSH模块 
3. 用户?密码方式d的,pȝ讄里设|如下:(x) 
4. 如果是证书登录的Q系l设|里讄如下Q?nbsp;
5. Job讄Q点d加构建后操作步骤Q选择send build artifacts over ssh, 讄如下Q?nbsp;
6. 文g上传到远E服务器后,q有一些后l操作,比如Q替换数据库配置文g。可以把bat命o(h)写到一个批处理文g中,存到服务器上。Exec command填写批处理文件的l对路径。如上图所C?/div>
关于bat脚本Q?nbsp;
如果每次都需要替换同L(fng)文gQ用copy /y 是无条g覆盖Q不?x)询问。而xcopy可以实现扚w拯文g和文件夹。如果文件较多可用此命o(h) 
注意脚本q行p|Q构Z?x)显C色成功图标,所以一定要打开控制台输出,看是否真的成功?/div>
--------------------- 
作者:(x)flyingshuai 
来源QCSDN 
原文Q?a target="_blank">https://blog.csdn.net/flyingshuai/article/details/72898665 
版权声明Q本文ؓ(f)博主原创文章Q{载请附上博文链接Q?/div>

paulwong 2019-07-25 09:33 发表评论
]]>How do I clear my Jenkins/Hudson build history?http://www.aygfsteel.com/paulwong/archive/2019/07/24/434289.htmlpaulwongpaulwongWed, 24 Jul 2019 08:18:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/07/24/434289.htmlhttp://www.aygfsteel.com/paulwong/comments/434289.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/07/24/434289.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/434289.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/434289.html阅读全文

paulwong 2019-07-24 16:18 发表评论
]]>
持箋部vQƈ不简单!http://www.aygfsteel.com/paulwong/archive/2015/05/14/425082.htmlpaulwongpaulwongThu, 14 May 2015 12:38:00 GMThttp://www.aygfsteel.com/paulwong/archive/2015/05/14/425082.htmlhttp://www.aygfsteel.com/paulwong/comments/425082.htmlhttp://www.aygfsteel.com/paulwong/archive/2015/05/14/425082.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/425082.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/425082.html阅读全文

paulwong 2015-05-14 20:38 发表评论
]]>
PMD for Jenkinshttp://www.aygfsteel.com/paulwong/archive/2014/07/12/415727.htmlpaulwongpaulwongSat, 12 Jul 2014 07:04:00 GMThttp://www.aygfsteel.com/paulwong/archive/2014/07/12/415727.htmlhttp://www.aygfsteel.com/paulwong/comments/415727.htmlhttp://www.aygfsteel.com/paulwong/archive/2014/07/12/415727.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/415727.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/415727.html
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
                <linkXRef>false</linkXRef>
                <targetJdk>1.6</targetJdk>
                <rulesets>
                    <ruleset>/rulesets/basic.xml</ruleset>
                </rulesets>
            </configuration>
        </plugin>
    </plugins>
</reporting>

Then PMD-jenkins will know where to pick up the results and publish them for you.

To get the results you will need to add this code to your pom.xml and execute the according target in Jenkins, yes.

Note that this is not related to PMD-plugin in Eclipse. The Eclipse PMD plugin just shows the result of the local analysis, not related to Jenkins.

paulwong 2014-07-12 15:04 发表评论
]]>
搭徏ZJenkins+SVN+Maven持箋集成环境(CI)http://www.aygfsteel.com/paulwong/archive/2014/07/12/415716.htmlpaulwongpaulwongFri, 11 Jul 2014 16:11:00 GMThttp://www.aygfsteel.com/paulwong/archive/2014/07/12/415716.htmlhttp://www.aygfsteel.com/paulwong/comments/415716.htmlhttp://www.aygfsteel.com/paulwong/archive/2014/07/12/415716.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/415716.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/415716.html一、准备工?/p>

1. 下蝲jenkins.warQ也可以使用特定环境的安装包。将其拷贝到c:\Dev\Jenkins目录

2. SVN, Maven

二、启动Jenkins

在命令行启动Jenkins

java -jar jenkins.war --httpPort=8080Q?--httpPort 用来指定端口受?/p>

在地址栏输入http://localhost:8080, 看到Jenkinsȝ面,p明安装成功了?/p>

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

三、Jenkins插g

保SVN和Maven插g都已l安装好了,可以到Jenkins配置里面L看,如果没有可以装上?/p>

Manage Jenkins->Manage Plugins->Installed

默认情况下,SVN和Maven插g都是安装好的Q如果你需要安装其他的插g可以在Available中查找?/p>

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

四、配|Jenkins

新安装的Jenkins需要配|一些环境,例如JAVA_HOME,MAVEN_HOME{?/p>

Manage Jenkins->Configure System

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

# of executors 用来指定同一旉最多能跑的job数量?/p>

SCM checkout retry count 如果从版本库{և代码p|Qjenkins?x)按照这个次数重试?/p>

JDK 配置Java环境, Maven 配置Maven环境?/p>

五、创建Mavend

New Job-> 新徏d

Job name->home-ciQci指代commit阶段Q说明这个job是用来不断集成我们的代码的?/p>

Build a maven2/3 project->我们的项目是用maven来管理的Q所以我们选择maven job

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

1. 首先我们配置SVNQ选择Subversion,填上目的Repository URL,然后可以指定从这个地址{և的代码保存的位置。其他默认选择?/p>

2. Build Trigger

该选项是用来配|自动构建的Q比如我们想让项目每天中午一点和晚上一点自动构建,只需要在Build periodically中写? 13,1 * * *.在这里我们用Poll SCMQ?Poll SCM"用来定期查版本库是否有更斎ͼ如果有更斎ͼ触发构徏。我们就让它每分钟检查一ơ,输入* * * * *?/p>

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

3. 配置Maven

pom.xml文gQjenkins?x)去L需要执行的maven pom文gQ需要给定?/p>

我们需要运行maven ?clean install 命o(h)Q在Goals and options中指定?/p>

4. 生成打包文g

Post-build Actions q里我们可以使用一些分析工P比如checkstyle, 代码试覆盖率等{?/p>

q里我们只指定需要生产的最l文件War或者JarQ在Archive the artifacts 中输入你惌的打包方式?/p>

/trunk/home/home-ci/*.war;/trunk/home/test-report/*.html

六、运行构?/p>

点击左侧的Build Now按钮Q点击Build History中的数字可以看到本ơ构建的详细?/p>

搭徏ZJenkins+SVN+Maven持箋集成环境(CI)

每次构徏可以点击Changes查看是否有更改, Console output可以看到本次构徏的详l输出?/p>

paulwong 2014-07-12 00:11 发表评论
]]>
Jenkins+Maven+SVN快速搭建持l集成环??http://www.aygfsteel.com/paulwong/archive/2014/07/11/415715.htmlpaulwongpaulwongFri, 11 Jul 2014 14:55:00 GMThttp://www.aygfsteel.com/paulwong/archive/2014/07/11/415715.htmlhttp://www.aygfsteel.com/paulwong/comments/415715.htmlhttp://www.aygfsteel.com/paulwong/archive/2014/07/11/415715.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/415715.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/415715.htmlJenkins是一个可扩展的持l集成引擎,Jenkins非常易于安装和配|,单易用,下面看看我们是如何几分钟快速搭Z个持l集成环境吧?/p>

假设我们目前已经?个maven目Qentities(JAVAcd)Qweb(Web应用Q依赖entities)?/p>

一、安装Jenkins

地址http://mirrors.jenkins-ci.org/下蝲适合的Jenkins版本?/p>

Windows最新稳定版的Jenkins地址为:(x)http://mirrors.jenkins-ci.org/windows-stable/jenkins-1.409.1.zip

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service

把Jenkins 1.409.1版解压,把得到的war包直接扔到tomcat下,启动tomcatQJenkins安装完毕,是不是很单啊?/p>

redhatpȝ下安装流E:(x)https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

二、配|Jenkins

1、打开http://10.3.15.78:8080/jenkins/Q第一ơ进入里面没有数据,我们需要创建jobQ我们这?个项目,需要创?个job?span style="line-height: 1.5; text-decoration: underline;">http://10.3.34.163:9890/jenkins/

2、点d上角的new jobQ在new job面需要选择job的类型,Jenkins支持几种cdQ我们选择“构徏一个maven2/3目”QJob名ؓ(f)Qguan_caijingQ如图所C:(x)

image

3、点击OK按钮后,q会(x)q入详细配置界面Q详l配|界面的配置很多,不过不用怕,大部分用默认配|就可以了,下面p说我们需要修改的几个地方Q?/p>

3.1QSource Code Management

因ؓ(f)我们使用SVN理源码Q所以这里选择SubversionQƈ在Repository URL中输入我们的SVN地址Q?/p>

http://10.3.34.163:9880/guan_caijing/trunk/

输入SVN库的URL地址后,Jenkins?x)自动验证地址Qƈl予提示?/p>

clip_image004

点击U色字体部分的enter credential链接Q进入如下页面:(x)

clip_image006

讄好访问SVN库的用户名和密码后,点击OK按钮Q显C:(x)

clip_image008

说明讄成功。点击Close按钮Q返回之前的Source Code Management面。此时不再有U色警告信息了?/p>

clip_image010

3.2Q配|自动构建的计划Q假设我们想让项目中每天12点和晚上8点自动构Zơ,只需要在Build Triggers中选择Build periodicallyQƈ在Schedule中输?0 12,20 * * *?/strong>

我配|的是每?点自动构?/strong>

clip_image012

注:(x)Schedule的配|规则是?个空格隔开的字W组成,从左到右分别代表Q分 ?nbsp;?nbsp;?nbsp;q?代表所有,0 12,20 * * * 表示“在Q何年M月Q何天?2?0??#8221;q行构徏?/strong>

3.3Q配|到q里Q可能有人发现在Build配置节点Q有U色错误信息Q提C?/p>

Jenkins needs to know where your Maven2 is installed. 
Please do so from the system configuration.

如图所C:(x)

clip_image014

q是因ؓ(f)Jenkins找不到maven的原因,点击"system configuration"Q是system configuration的maven配置中添加maven目录O(jin)KQ如下图Q?/p>

clip_image016

我设|了JRE 6和MAVEN 3的安装目录?/p>

点击左下角的SAVE按钮Q保存设|?/p>

3.4Q保存好所有配|后Q我们第1个jobq是完成了?/p>

3.5Q创建第2个jobQ配|和上面的配|相同。只需把svn地址Ҏ(gu)Q?span style="line-height: 1.5; text-decoration: underline;">http://localhost/svn/Web

三、手动构?/h4>

在经q上面的配置后,回到Jenkins首页Q在首页可以看到刚才d?个jobQ如下图Q?/p>

clip_image018

点击?个job后后面的"Schedule a build"囄手动构徏Q点d后,?x)在左边的Build Queue或?span style="line-height: 1.5; text-decoration: underline;">Build Executor Status 昄正在构徏的Q务,在自动构建完后,h面Q就可以看到构徏l果了,如何某个目构徏p|Q点击项目后面的构徏数字(?开始递增)q入目?Console Output "可以查看目构徏p|的原因。当然我们也可以配置把构建失败的l果发到邮箱?/p>

到目前ؓ(f)止,1个简单的自动构徏环境?yu)搭建好了,很简单吧?/p>

四、自动部|?/h4>

看完上面发现Jenkins配置真的很简单,几分钟就搭徏好自动构建环境,但环境搭建好后发?个问题,现在是能自动构徏了,但是构徏好的web.war都还是在Jenkins目录下,q没有发布到tomcat中,q需要手动copyq去Q?/p>

q是个问题,不过别急,要达到自动部|的目的Q需要安?个Jenkins的部|插件。选择“pȝ理”菜单?#8220;理插g”Q?/p>

clip_image020

选择“可选插?#8221;Q找到Deploy Plugin 1.8插gQ选择它?/p>

clip_image022

注:(x)Deploy Plugin 1.8插g支持Tomcat 4.x/5.x/6.x/7.x QJBoss 3.x/4.x QGlassfish 2.x/3.x

点击底部?#8220;安装”按钮Q显C:(x)

clip_image024

耐心{待Q?/p>

clip_image026

直到Deploy Plugin完成Q显CSuccessQ?/p>

clip_image028

选择框打钩,Jenkins?x)自动重启?x)

clip_image030

此时Q在插g理?#8220;已安?#8221;Tab,可以看到部v插g已安装完毕?/p>

clip_image032

重新q入web的configure 配置界面Q在最下面?x)发现多?个配|项Q我们配|如下:(x)

clip_image034

注:(x)war file使用的是Jenkinsworkspace的相对目录,hudon默认的目录在Q?/p>

C:\Documents and Settings\用户名\.Jenkins\

workspace目录QC:\Documents and Settings\用户名\.Jenkins\ jobs\web\workspace\

最l生的war在:(x)C:\Documents and Settings\用户名\.Jenkins\ jobs\web\workspace\Web\target\web.war

保存配置再重新构Zơ,打开tomcat的webapps目录Q发现web.warl于q来了,大功告成?/p>

paulwong 2014-07-11 22:55 发表评论
]]>hudson+maven+sonar+svn 快速搭建持l集成服?/title><link>http://www.aygfsteel.com/paulwong/archive/2012/09/26/388642.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 26 Sep 2012 15:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2012/09/26/388642.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/388642.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2012/09/26/388642.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/388642.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/388642.html</trackback:ping><description><![CDATA[<a href="http://www.aygfsteel.com/Nirvana/archive/2012/09/10/387404.html" target="_blank">http://www.aygfsteel.com/Nirvana/archive/2012/09/10/387404.html<br /><br /></a><a href="http://www.aygfsteel.com/Nirvana/archive/2012/09/10/387408.html" target="_blank">http://www.aygfsteel.com/Nirvana/archive/2012/09/10/387408.html</a><img src ="http://www.aygfsteel.com/paulwong/aggbug/388642.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2012-09-26 23:15 <a href="http://www.aygfsteel.com/paulwong/archive/2012/09/26/388642.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个完整的JENKINS下的ANT BUILD.XML文ghttp://www.aygfsteel.com/paulwong/archive/2012/02/08/369617.htmlpaulwongpaulwongWed, 08 Feb 2012 10:40:00 GMThttp://www.aygfsteel.com/paulwong/archive/2012/02/08/369617.htmlhttp://www.aygfsteel.com/paulwong/comments/369617.htmlhttp://www.aygfsteel.com/paulwong/archive/2012/02/08/369617.html#Feedback1http://www.aygfsteel.com/paulwong/comments/commentRss/369617.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/369617.html<?xml version="1.0" encoding="UTF-8"?><project name="genwar" default="all...  阅读全文

paulwong 2012-02-08 18:40 发表评论
]]>
JENKINS使用步骤http://www.aygfsteel.com/paulwong/archive/2012/01/31/369103.htmlpaulwongpaulwongTue, 31 Jan 2012 10:19:00 GMThttp://www.aygfsteel.com/paulwong/archive/2012/01/31/369103.htmlhttp://www.aygfsteel.com/paulwong/comments/369103.htmlhttp://www.aygfsteel.com/paulwong/archive/2012/01/31/369103.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/369103.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/369103.html
有,q就是JENKINSQ有了她Q你可以:(x)通过l一的WEB界面做各U配|工作、查看工L(fng)LOG输出、即使是历史的日志查看也没问题;通知配置排程Q可以自动的获取代码、编译、打包和部vQ发邮gQ无Mh工干预?
  1. 安装JENKINSQ其实就是把一个WAR包放到容器中
  2. 安装插gQ发邮g插gJenkins Email Extension Plugin和部|插?a >Deploy to container Plugin
  3. 配置JDK和邮件服务器地址
  4. 新徏dQ配|SVN地址/配置构徏排程@hourly/配置构徏步骤Q如先用ANT~译打包再传到服务器/配置成功或失败后发邮仉知的地址
  5. 手动执行d或等待时间到了后执行d
各种插g的安?
  1. ANTQ如果在JENKINS中用了ANT-JUNITQ由于JENKINS是直接调用操作系l的ANT命o(h)的,所以要在LINUX下安装ANTQ配|ANT_HOMEQƈBIN加入到PATH中:(x)
    ANT_HOME=/opt/ant/apache-ant-1.8.2
    JAVA_HOME
    =/usr/java/jdk1.6.0_29
    JRE_HOME
    =/usr/java/jdk1.6.0_29/jre
    PATH
    =$ANT_HOME/bin:$JAVA_HOME/bin:JRE_HOME/bin:$PATH 
    CLASSPATH
    =.:$JAVA_HOME/lib/jt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
    export ANT_HOME JAVA_HOME JRE_HOME PATH CLASSPATH

http://hanqunfeng.iteye.com/category/138233



paulwong 2012-01-31 18:19 发表评论
]]>
վ֩ģ壺 | | | | Ϻ| Ҧ| Դ| ˳ƽ| | Զ| Ȩ| | ͨɽ| ˳ƽ| ϲ| ƺ| | Ӷ| | ƽ| | | | | ɽ| ƽ| | ̨| ʡ| | ׯ| | | | | ͨ| | | ˫| ѽ| |