IOS 自动化部署

BuildKit是一个模块化的命令行界面的自动化项目的iOS版本。 BuildKit旨在从配置持续集成环境的疼痛减轻您和构建过程。

捆绑的构建任务包括:

增加内部版本号

画上的应用程序图标的版本号

构建应用程序

运行单元测试

产生的.ipa假象

BuildKit分布作为Ruby gem与可以在持续集成服务器环境或者在开发机器上启动一个可执行文件。这个过程与配置描述任务运行一个简单的YAML文件,你的项目的具体方案。这意味着您可以定制构建过程来满足您的要求。

这是与iOS7和iOS8 SDK与Objective-C和swift项目兼容。

Usage

BuildKit is launched from a command line environment with:

buildkit

Pass a configuration file to BuildKit with:

buildkit your-config-file.yml

Configuration
Files

The configuration file describes three things:

  1. Task modules to run (and task-specific options)
  2. Project configuration
  3. User preferences

An example configuration file:

:tasks:
  :increment_version:
    :run: true
    :options:
  :decorate_icon:
    :run: true
    :options:
  :xcode_build:
    :run: true
    :options:
      :log: true
      :clean: true
  :run_tests:
    :run: false
    :options:
        :log: true
  :create_ipa:
    :run: true
    :options:
        :log: true

:configuration:
  :app_name: "BuildKit"
  :workspace: "BuildKit.xcworkspace"
  :info_plist: "BuildKit/BuildKit-Info.plist"
  :build_configuration: "Release"
  :scheme: "BuildKit"
  :sdk: "iphoneos"
  :provisioning_profile: "Provisioning/BuildKitTest.mobileprovision"
  :code_sign: "iPhone Distribution: Alpaca Labs"
  :icon_dir: "BuildKit/Icon/"
  :build_dir: "Builds"

:preferences:
  :reports: "Reports"

Setting
Tasks

The :tasks: symbol is used to define what tasks you would like your process to run. If :run: is
set to true on a particular task then that task will be executed as part of the build process. Setting:run: to false will
mean that the task is skipped (note that some tasks depend on others, and may cause a graceful failure). In the examle above all tasks but for run_tests will
be executed.

The tasks will be run in the order that they appear in the list. It‘s recommended to follow the order shown in the example as they‘ve been ordered to provide the best value to the process. In the example: 1. The build version is incremented with increment_version 2.
The newly incremented version is rendered on the app icon with decorate_icon 3. Lastly xcode_build and create_ipa are
run to build and create an ipa, which if installed on a device, will have the version number overlayed on the icon.

Anything passed with the :options: symbol will be provided as an option. For example, taking the example configuration
file above the :log: option on the run_tests task
is set to true so the test output will be printed to the CLI.

The Tasks section in this README describes all of the options available to each task.

Setting
Project Configuration

To run the task modules successfully requires some project-specific configuration, this is done under the :configuration: symbol.

  • :app_name:: Your app‘s name!
  • :workspace:: The path to your workspace (note that single Xcode project files aren‘t supported).
  • :info_plist:: The path to your app‘s main info-plist file.
  • :build_configuration:: Your build configuration (normally "Release" or suchlike)
  • :scheme:: Project scheme to build
  • :sdk:: SDK to build with (example: "iphoneos")
  • :provisioning_profile:: Path to a provisioning profile to sign the app with.
  • :code_sign:: The code signature, this is found in Xcode next to a selected provisioning profile
    (example: "iPhone Distribution: Alpaca Labs"). I recommend this OSX quick look plug in if you want to inspect
    profiles.
  • :icon_dir:: The path to a directory containing you icon image files. More on this in the Tasksdecorate_icon section
    of this README.
  • :build_dir:: The path to drop any build and ipa files after they have been created.

Note: if some required configuration has not been provided, or an invalid location has been provided for an option that requires a path, then BuildKit will gracefully fail.

Setting
User Preferences

BuildKit can be configured to suit your own preference too. This is done under the :preferences:symbol. For
example, to switch on build report generation set the :reports: symbol to true.
User preferences are further described in the User Preferences section of this README.

Build
Tasks

BuildKit comes packaged with the following task modules:

  • increment_version: Increment the build number
  • decorate_icon: Overlay the version number on the app icon
  • xcode_build: Build the app
  • run_tests: Run unit tests
  • create_ipa: Generate an .ipa artefact

increment_version

Increments the build version number in the Info-plist.

Requires configuration:

  • :info_plist:

decorate_icon

Duplicates your app icon files and renders the version number on top (incremented withincrement_version or
not).

Decorate icon requires some convention for optimal usage:

  1. The app icon files should be contained in a dedicated directory of their own.
  2. Drop the icon directory in to Xcode as a folder reference rather than a group.
  3. Set the icon files in your Info-plist as:
<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>CONTAININGFOLDER/Decorated-ICONFILENAME</string>
            <string>CONTAININGFOLDER/Decorated-ICONFILENAME</string>
            <string>CONTAININGFOLDER/Decorated-ICONFILENAME</string>
        </array>
    </dict>
</dict>

If you‘re unsure check the example project.

Requires configuration:

  • :info_plist:
  • :icon_dir:

xcode_build

Builds the project (with optional clean before build).

Options:

  • log: logs the output to the console
  • clean: clean before build

Requires configuration:

  • :app_name:
  • :workspace:
  • :sdk:
  • :build_configuration:
  • :build_dir:
  • :scheme:

Note: Special thanks to @supermarin for making the output beautiful with his xcpretty gem
(same forrun_tests)

run_tests

Runs unit tests. XCTest, Kiwi and Specta/Expecta are
all supported

Options:

  • log: logs the output to the console

Requires configuration:

  • :workspace:
  • :scheme:

create_ipa

Creates an .ipa build artefact and drops it in build directory specified in the config file.

Options:

  • log: logs the output to the console

Requires previous tasks:

  • xcode_build

Requires configuration:

  • Everything required for xcode_build

User
Preferences

BuildKit includes some user preferences that can be enabled under the :preferences: symbol of a config file.

User
Preferences: Create Reports

Set :reports: to a directory in your config file to create a JSON report containing the project configuration,
build time, build outputs and test outputs after a BuildKit run has completed.

Leaving the :reports: preference blank will skip report generation.

Examples

An example workspace has been included in the repo if you want to try it out. You may need to change the paths in the build_config.yml configuration
file first and run a pod install.

Roadmap

Lots of plans for BuildKit:

  • Create a build task module to enable artefact distribution by wrapping Shenzhen (in progress).
  • Add a generator for config files (next up).
  • Add a means to allow custom task modules to be added to the process.
  • Make decorate_icon compatible with Xcode 5 asset catalogues.

Contributing

All pull requests welcome! Please ensure that all existing RSpec specs pass, and that any new features are covered with specs. Please keep the README up to date.

Contact

@adamwaite

License

Copyright (c) 2014 Adam Waite. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

github:https://github.com/adamwaite/iOS-Build-Kit

时间: 2024-10-10 06:14:45

IOS 自动化部署的相关文章

转 Apache Ant 实现自动化部署

Apache Ant 实现自动化部署 Apache Ant 实现自动化部署 http://www.netkiller.cn/journal/java.ant.html Mr. Neo Chen (陈景峯), netkiller, BG7NYT 版权声明 转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明. 文档出处: http://netkiller.github.io http://netkiller.sourceforge.net 微信扫描二维码进入 Netkiller 微信订

关于自动化部署之docker容器的折腾小记

docker的英文本意是码头工人,也就是搬运工,这种搬运工搬运的是集装箱(Container),集装箱里面装的可不是商品货物,而是任意类型的App,Docker把App(叫Payload)装在Container内,通过Linux Container技术的包装将App变成一种标准化的.可移植的.自管理的组件,这种组件可以在你的latop上开发.调试.运行,最终非常方便和一致地运行在production环境下. 具体什么是docker,你们自己找资料吧,应该好理解.   可以说是个运维的利器,可以把

搭建Puppet自动化部署环境

最近项目上线,自己在部署过程中发现很多问题,发现没有自动化部署工具简直就是纯体力活儿,费时又费力,干的事就是那几个,就不能"一键完成么"的想法油然而生,答案是肯定的,自动化的工具有很多,之所以安装Puppet,只是因为比起别的软件,这款软件原来有学习过,现在又重新拾起来,要把它用到生产环境中,让运维工作不再是体力活,而是实现,全自动部署,更新,这篇只是聊聊安装和配置Puppet,后续还会写具体在生产环境中如何实现自动化代码更新,软件部署等,敬请期待~ 环境介绍: puppetserve

salt分布式自动化部署平台

集中管理平台上安装salt-master 各个交易所监控机上安装salt-minion和salt-master,各个客户端安装salt-minion; salt-master管理各个监控机,监控机管理各个客户端,这样实现统一自动化部署.

持续集成+自动化部署[代码流水线管理及Jenkins和gitlab集成]

持续集成+自动化部署[代码流水线管理及Jenkins和gitlab集成] 标签(空格分隔): Jenkins 一.代码流水线管理 Pipeline名词顾名思义就是流水线的意思,因为公司可能会有很多项目.如果使用jenkins构建完成后,开发构建项目需要一项一项点击,比较麻烦.所以出现pipeline名词. 代码质量检查完毕之后,我们需要将代码部署到测试环境上去,进行自动化测试 新建部署代码项目 点击新建 这里只需要写一下描述 执行Shell脚本 温馨提示:执行命令主要涉及的是权限问题,我们要搞明

cobbler之自动化部署ubuntu14

概述    本例主要实现通过cobbler,配合seed脚本文件,来自动化安装部署ubunut环境,并安装相应的软件并作相应的基本配置,可以通过此方法来为ceph等大规模集群基础部署. seed文件:Debian ubuntu平台的一种自动化部署配置文件 和kickstart文件功能相同.其实ubuntu也可以使用ks文件,但是只能进行基本的环境配置,不能自定义包的安装和脚本的运行. 实验环境 cobbler-server: 1.1.1.122 centos7.2 ubuntu 客户端:kvm虚

MDT 2013 从入门到精通之自动化部署WinSer 2008 R2

因加班等问题,前一段时间我们只更新了MDT 2013从入门到精通系列的前半部分,趁着阅兵休息的这几天,为大家奉上后续的部分,供大家学习参考,如有不足还请大家多多包涵.正如我们所知道的,MDT其实不止能部署用户端操作系统,还可以部署Server服务器端操作系统,今天为大家带来有关MDT 2013如何部署Windows Server 2008 R2企业版操作系统,实现自动化操作,减轻工程师工作量等: 一.导入系统镜像: 1.在MDT控制台Operating Systems项中添加对应Server 版

MDT 2013 从入门到精通之自动化部署WinSer 2012 R2

Windows Server 2012 R2 是由Microsoft设计开发的新一代的服务器专属操作系统,其核心版本号为 Windows NT 6.3 .提供企业级数据中心与混合云解决方案,直观且易于部署.具有成本效益.以应用程序为重点.以用户体验为中心,深受广大 IDC 运营商青睐.之前有好多朋友说MDT无法部署全新设计后的2012,本文将简单介绍该服务器操作系统的自动化部署过程.同时建议大家在使用MDT的时候多测试,因为实践是检验真理的唯一标准,我们测试的结果是为了我们更好的部署自动化,可能

MySQL主从复制原理及配置详细过程以及主从复制集群自动化部署的实现

Technorati 标签: 那你魔鬼 一.复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重新执行一遍来实现的.复制过程中一个服务器充当主服务器,而一个或多个其它服务器充当从服务器.主服务器将更新写入二进制日志文件,并维护文件的一个索引以跟踪日志循环.这些日志可以记录发送到从服务器的更新.当一个从服务器连接主服务器时,它通知主服务器从服务器在日志中读