当前位置:网站首页>百度APP 基于Pipeline as Code的持续集成实践
百度APP 基于Pipeline as Code的持续集成实践
2022-06-28 12:33:00 【InfoQ】

一、概述


# playbook
- name: Install Xcode
block:
- name: check that the xcode archive is valid
command: >
pkgutil --check-signature {{ xcode_xip_location }} |
grep \"Status: signed Apple Software\"
- name: Clean up existing Xcode installation
file:
path: /Applications/Xcode.app
state: absent
- name: Install Xcode from XIP file Location
command: xip --expand {{ xcode_xip_location }}
args:
chdir: /Applications
poll: 5
async: "{{ xcode_xip_extraction_timeout }}" # Prevent SSH connections timing out waiting for extraction
- name: Accept License Agreement
command: "{{ xcode_build }} -license accept"
become: true
- name: Run Xcode first launch
command: "{{ xcode_build }} -runFirstLaunch"
become: true
when: xcode_major_version | int >= 13
when: not xcode_installed or xcode_installed_version is version(xcode_target_version, '!=')
- 让产品线团队只需要关注流水线当前版本的DSL,方便团队内部成员共同维护和升级;
- 流水线本身的环境配置也是DSL的一部分,消除流水线环境由于配置混乱造成的特异性;
- DSL非常容易复制和链接代码片段,可以将CI脚本组件化之后作为一种可配置的DSL单元。


- Checkout:从 Git 服务器下拉源码
- Build:执行 xcodebuild 编译命令
- UseMyLibrary:引用自定义的脚本方法
// Jenkinsfile(Declarative Pipeline)
@Library('my-library') _
pipeline {
agent {
node {
label 'MACOS'
}
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
sh 'xcodebuild -workspace projectname.xcworkspace -scheme schemename -destination generic/platform=iOS'
}
}
stage('UseMyLibrary') {
steps {
myCustomFunc 'Hello world'
}
}
}
}
# .github/workflows/ios.yml
name: iOS workflow
on: [push]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Build
run: xcodebuild -workspace projectname.xcworkspace -scheme schemename -destination generic/platform=iOS
- name: UseMyLibrary
uses: my-library/[email protected]
with:
args: Hello world
# baiduapp/ios/publish.ymlname: 'iOS Module Publish Workflow'author: 'zhuyusong'description: 'iOS 组件发布流程'on: events: topic_merge: branches: ['master', 'release/**'] repositories: ['baidu/baidu-app/*', 'baidu/third-party/*']jobs: publish: name: 'publish modules using Easybox' runs-on: macos-latest steps: - name: 'Checkout' uses: actions/[email protected] - name: 'Setup Easybox' uses: actions/[email protected] with: is_public_storage: true - name: 'Build Task use Easybox' uses: actions/[email protected]: component_check: true quality_check: true - name: 'Publish Task use Easybox' uses: actions/[email protected] - name: 'Access Task use Easybox' uses:actions/[email protected]





丨细节1. Action和 Runner 的交互方式
- 环境变量:Runner将需要传递给Action的参数写入环境变量中,一般包括Action所需的输入以及一些上下文;
- 工作区文件:Runner将需要传递给Action的文件放入工作区特定的文件夹中,一般是Action所需的中间产物;
- Action 的打印:Runner 在执行 Action 的过程中会不断监听 Action 的打印内容,Runner 和 Action 约定了一套带有特殊命令标识符的打印语句,当Runner监听到此类语句时会解析并执行预设的命令,包括设置输出,打印日志和上传产物等。
丨细节2. Pause/Unpause 的作用
丨细节3. WebAPI 的作用
边栏推荐
- Jerry's SPI1 plug-in flash recording modification [part]
- [unity Editor Extension Foundation], editorguilayout (I)
- Jerry's wif interferes with Bluetooth [chapter]
- 杰理之wif 干扰蓝牙【篇】
- Unity导入资源后还手动修改资源的属性?这段代码可以给你节约很多时间:AssetPostprocessor
- 分页样式 flex设置成在尾部显示(即使页数加长 也不会因为在末尾而换行)
- Setting overridesorting for canvas does not take effect
- Url追加参数方法,考虑#、?、$的情况
- Levels – virtual engine scene production "suggestions collection"
- [C language] about scanf() and scanf_ Some problems of s()
猜你喜欢

几百行代码实现一个 JSON 解析器

自定义标题栏View

不到一小时,苹果摧毁了15家初创公司

ASP.NET CORE Study02

IPETRONIK数据采集设备携手Softing Q-Vision软件致力于ADAS测试方案
![[unity Editor Extension Foundation], editorguilayout (I)](/img/f2/42413a4135fd6181bf311b685504b2.png)
[unity Editor Extension Foundation], editorguilayout (I)

智联招聘基于 Nebula Graph 的推荐实践分享

newest! Introduction and practical tutorial of point cloud processing based on open3d

【Unity编辑器扩展基础】、EditorGUILayout(二)

Mathematical principle derivation of structured light phase shift method + multifrequency heterodyne
随机推荐
ASP.NET CORE Study05
Bytev builds a dynamic digital twin network security platform -- helping network security development
【Unity编辑器扩展基础】、EditorGUILayout (三)
Two writing methods of JNI function
My NVIDIA developer tour -jetson nano 2GB teaches you how to train models (complete model training routines)
ASP. NET CORE Study01
UGUI使用小技巧(六)Unity实现字符串竖行显示
Unity Editor Extension Foundation, editorguilayout (II)
最新汇总!30省份公布2022高考分数线
攻防世界新手入门hello_pwn
Pyqt5 visual development
EMC RS485 interface EMC circuit design scheme
2022招商FinTech比赛总结
什么是数据合规?怎样做到数据合规?
ASP.NET CORE Study04
思源官方付费同步使用指南
Given two points and a point with a middle scale, find the coordinates of the point
Jerry's wif interferes with Bluetooth [chapter]
分页样式 flex设置成在尾部显示(即使页数加长 也不会因为在末尾而换行)
洛谷_P1303 A*B Problem_高精度计算