1 下载链接
2 cd 到下载文件目录
3 java -jar jenkins.war
4 浏览器:http://localhost:8080
5 按照建议安装插件 注册账号 完成安装
重点名词介绍
Jenkins Pipeline
is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins. Pipeline provides an extensible set of tools for modeling simple-to-complex delivery pipelines "as code".
A
Jenkinsfile
is a text file that contains the definition of a Jenkins Pipeline and is checked into source control. [1] This is the foundation of "Pipeline-as-Code"; treating the continuous delivery pipeline a part of the application to be version and reviewed like any other code. Creating a Jenkinsfile provides a number of immediate benefits:
- Automatically create Pipelines for all Branches and Pull Requests
- Code review/iteration on the Pipeline
- Audit trail for the Pipeline
- Single source of truth for the Pipeline, which can be viewed and edited by multiple members of the project.
While the syntax for defining a Pipeline, either in the web UI or with a Jenkinsfile, is the same, it’s generally considered best practice to define the Pipeline in a Jenkinsfile and check that in to source control.
配置证书和配置文件
1 /用户/xxxx/资源库/Keychains/login.keychain 该文件需要上传到 Keychains and Provisioning Profiles Management
插件中
2 将证书GeneralName拷贝到证书栏
3 设置配置文件路径
4 刷新并保存后再次进入就可以选择Keychain和证书了
(注意:我第一次导入证书和Provisioning Profiles文件,就遇到了一点小“坑”,我当时以为是需要证书,但是这里需要的Keychain,并不是cer证书文件。这个Keychain其实在/Users/管理员用户名/Library/keychains/login.keychain,当把这个Keychain设置好了之后,Jenkins会把这个Keychain拷贝到/Users/Shared/Jenkins/Library/keychains这里,(Library是隐藏文件)。Provisioning Profiles文件也直接拷贝到/Users/Shared/Jenkins/Library/MobileDevice文件目录下。)
参数化构建过程
Choice 类型
String 类型
...
设置后后主页面板会发生变化
之后可以在脚本中使用这个参数, 利用sed转换字符串参数,例如:参数为DEMO_PARMS 必须使用英文
DEMO_PARMS=`echo $DEMO_PARMS | sed -r 's/"//g'`
DEMO_PARMS=`echo $DEMO_PARMS | sed -r 's/,/ /g'`
首先替换引号,然后替换逗号成空格。方便shell进行循环。