Jenkins

作者: FreeLeaves | 来源:发表于2017-03-24 09:41 被阅读0次

    使用终端安装Jenkins

    1、安装Jenkins

    $ brew install jenkins

    如果brew无效,安装homebrew

    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    

    2、启动Jenkins

    $ jenkins

    如果要卸载Jenkins及相关配置

    //进入以下目录,双击运行
    /Library/Application Support/Jenkins/Uninstall.command
    //也可以这样运行
    sh "/Library/Application Support/Jenkins/Uninstall.command"
    
    //删除配置,这个可选
    sudo rm -rf /var/root/.jenkins ~/.jenkins
    sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
    sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
    sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins
    sudo rm -rf /Users/Shared/Jenkins
    sudo dscl . -delete /Users/jenkins
    sudo dscl . -delete /Groups/jenkins
    sudo rm -f /etc/newsyslog.d/jenkins.conf
    pkgutil --pkgs | grep 'org\.jenkins-ci\.' | xargs -n 1 sudo pkgutil --forget
    
    //如果使用brew安装的,可以执行以下命令
    $ brew uninstall jenkins
    
    启动成功.png

    3、在浏览器中输入http://localhost:8080

    主页.png

    4、安装插件

    Xcode integration
    GIT plugin
    Post-Build Script Plug-in
    GitHub plugin

    插件安装.png 选择可选插件并搜索.png

    5、配置SSH Key

    ![输入私钥.png](https://img.haomeiwen.com/i4068231/99bd70025066b379.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

    6、构建一个自由风格的软件项目

    构建一个自由风格的软件项目.png

    7、配置项目

    7.1基本信息

    基本信息.png

    7.2源码管理

    源码管理.png

    7.3构建

    添加构建步骤->选择Xcode

    1. Target:Target和项目中Target的名字一致
    1. Clean before build:设为Yes
    2. Configuration:选择release(默认为release)
    3. .ipa filename pattern:打包后的文件名字。随便写一个
    4. Output directory:.ipa文件的输出路径${WORKSPACE}/build/
    构建.png

    添加构建步骤->Code signing & OS X keychain options

    1. 选择Unlock Keychain
    1. Keychain Path: ${HOME}/Library/Keychains/login.keychain
    2. Keychain password:电脑登录密码
    keyChain.png

    8、增加构建步骤

    增加构建步骤->选择Execute shell

    上传到蒲公英

    1. file:.ipa文件路径
    1. uKey:蒲公英上可以看到
    2. _api_key:蒲公英上可以看到
    蒲公英.png
    curl -F "file=@ipa所在路径" -F "uKey=用户User Key" -F "_api_key=用户API Key" http://www.pgyer.com/apiv1/app/upload
    

    参考资料

    jenkins+Xcode+蒲公英实现ipa自动打包发布全攻略
    Jenkins+GitHub+Xcode+fir搭了一个持续集成环境
    手把手教你利用Jenkins持续集成iOS项目

    相关文章

      网友评论

          本文标题:Jenkins

          本文链接:https://www.haomeiwen.com/subject/oznnnttx.html