Build log exceeded limit of 4194304 bytes报错

该错误由于runner默认日志大小过小引起,需要修改runner的默认配置
mac下路径为

~/.gitlab-runner/config.toml

因为mac权限的原因,此配置在用户目录下,并不在linix的/etc目录下

ipa生成目录和下载目录

可以将生成的ipa指向其他任意目录,但是如果要配置artifacts下载,则只能配置当前目录下的内容。

artifacts的下载地址

artifacts中配置的下载内容,是job完成后上传到git上的,此处以ipa为例,当我们打完ipa包后,如果配置有artifacts下载,则会将配置的path下的内容上传到git上,会增加较长的执行时间

另外,artifacts中配置的name,是下载下来保存的zip的名字,而在gitlab-ci 的web界面上看到的下载链接名,是artifacts所在的stage的名字。

最后奉上一个打包实例yml的配置,敏感词用**代替

variables:
    CONFIGURATION: "Debug"
    WORKSPACE: "./Example/****.xcworkspace"
    SCHEME_NAME: "****"
    EXPORT_MAIN_DIRECTORY: "build"
    EXPORT_OPTIONS_PLIST: "/Users/****/Documents/Output_IPA/exportOptions.plist"
    CODE_SIGN_IDENTITY: "xxxxxx"
    PROVISIONING_PROFILE: "xxxxx"
    LANG: "en_US.UTF-8"

stages:
  - makedir
  - archive
  - ipa
dir_project:
  stage : makedir
  script :
        - mkdir $EXPORT_MAIN_DIRECTORY
        - EXPORT_MAIN_DIRECTORY=$EXPORT_MAIN_DIRECTORY/$(date "+%Y%m%d%H%M%S")
        - echo $EXPORT_MAIN_DIRECTORY
        - mkdir $EXPORT_MAIN_DIRECTORY
archive_project:
  stage : archive
  script :
        - xcodebuild clean -workspace $WORKSPACE -scheme $SCHEME_NAME
        - xcodebuild -workspace $WORKSPACE -scheme $SCHEME_NAME -configuration Debug archive -archivePath $EXPORT_MAIN_DIRECTORY/$SCHEME_NAME.xcarchive
  artifacts:
    expire_in: '2 day'
    name: "下载xcarchive,保留2天"
    paths:
        - $EXPORT_MAIN_DIRECTORY/$SCHEME_NAME.xcarchive
ipa_project:
  stage: ipa
  script:
        - echo 'export ipa'
        - xcodebuild -exportArchive -archivePath $EXPORT_MAIN_DIRECTORY/$SCHEME_NAME.xcarchive -exportPath $EXPORT_MAIN_DIRECTORY -exportOptionsPlist $EXPORT_OPTIONS_PLIST
  artifacts:
    expire_in: '5 day'
    name: "下载ipa,保留5天"
    paths:
        - $EXPORT_MAIN_DIRECTORY/$SCHEME_NAME.ipa
  only:
        - master

标签: gitlab ci, iOS, 持续集成, yml配置, xcodebuild

添加新评论