Jenkins+Git(svn)+Ant(Maven)

来源:互联网 发布:我国网络舆论的特点是 编辑:程序博客网 时间:2024/05/19 06:35

2013-6-25

管理:Jenkins

实现:Ant(Maven)

协调:Git(Svn)

以下是今天所遇到的问题,详见如下:



  • (1)

Q:

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/helloword/workspace
[HelloAnt] $ ant -file build.xml
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?
java.io.IOException: Cannot run program "ant" (in directory "/home/xiongmc/android/project/workspace/HelloAnt"): java.io.IOException: error=2, No such file or directory
==========================================
A:
http://www.yolinux.com/TUTORIALS/Jenkins.html


or

Configure System
Configure global settings and paths.


总结:
JDK_HOME和ANT_HOME未配置。

  • (2)

Q:

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/helloword/workspace
[HelloAnt] $ /opt/apache/apache-ant-1.9.1/bin/ant -file build.xml
Buildfile: /home/xiongmc/android/project/workspace/HelloAnt/build.xml


main:
    [javac] /home/xiongmc/android/project/workspace/HelloAnt/build.xml:10: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /home/xiongmc/android/project/workspace/HelloAnt/build/classes
    [javac] /home/xiongmc/android/project/workspace/HelloAnt/src/com/hht/ant/MainAnt.java:8: 错误: 写入MainAnt时出错: /home/xiongmc/android/project/workspace/HelloAnt/build/classes/com/hht/ant/MainAnt.class (权限不够)
    [javac] public class MainAnt{
    [javac]        ^
    [javac] 1 个错误


BUILD FAILED
/home/xiongmc/android/project/workspace/HelloAnt/build.xml:10: Compile failed; see the compiler error output for details.


Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE



A:
xiongmc@xiongmc-desktop:~/android/project/workspace$ sudo chmod 777 HelloAnt/ -R[sudo] password for xiongmc: 
xiongmc@xiongmc-desktop:~/android/project/workspace$ ls -l
总用量 8
drwxrwxrwx 6 xiongmc xiongmc 4096  6月 25 10:37 HelloAnt


================
总结:
被动拦截,事实已经存在的关卡。
主动拦截,设置关卡。

  • 举一反三:






  • (3)Jenkins没有Git插件,需要安装,通过配置安装。jenkins for git plguin 
http://www.linuxidc.com/Linux/2011-12/49602.htm


Linux下构建robotium+jenkins+TMTS可持续集成自动化测试
http://www.linuxidc.com/Linux/2013-06/85633.htm




  • (4)为了集成到SCM,我们在Linxu上安装GIT服务器
http://www.examw.com/linux/all/182529/index-2.html

在LINUX上创建GIT服务器
http://lionest.iteye.com/blog/1447310
http://blog.csdn.net/andy_android/article/details/6996134



  • (5) 通过GIT服务器,取分支出现以下问题。
Q:
xiongmc@xiongmc-desktop:~/myproject.git$ git push origin master ssh: connect to host xiongmc-desktop port 22: Connection refused
fatal: The remote end hung up unexpectedly
xiongmc@xiongmc-desktop:~/myproject.git$ git push origin master 
ssh: connect to host xiongmc-desktop port 22: Connection refused
fatal: The remote end hung up unexpectedly


A:
http://blog.csdn.net/zlm_250/article/details/7979221


sudo apt-get install openssh-server
sudo net start sshd  
sudo ufw disable 
ssh localhost  


  • (6)
Q:
ubuntu系统下“关于'xx'用户不在 sudoers文件中,此事将被报告。”的解决方法


A:
http://blog.sina.com.cn/s/blog_bede36550101b0av.html
git ALL=(ALL:ALL) ALL


(7)
Q:
xiongmc@xiongmc-desktop:~/myproject.git$ git push origin master 
git@xiongmc-desktop's password: 
fatal: '/opt/git/project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly


A:
http://www.dotkam.com/2010/08/22/gitolite-does-not-appear-to-be-a-git-repository/