簡體   English   中英

添加APK到zip Gitlab-CI? 工件.gitlab-ci.yml配置

[英]Add apk to zip Gitlab-CI? Artifacts .gitlab-ci.yml Configuration

按照http://doc.gitlab.com/ee/ci/yaml/README.html的文檔設置文件.yml時,我通過創建工件發現了問題,當構建要下載的APK文件時,此ZIP包含所有文件夾: app / build / outputs / apk ,我只想將生成的APK添加到要下載的ZIP文件中。

.gitlab-ci.yml

dev:
 script:
       - ./gradlew assembleDebug

 artifacts:
    name: "$CI_BUILD_NAME"
    paths:
         - app/build/outputs/apk/app-debug.apk

build.gradle文件:

applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def apk = output.outputFile;
            def newName = "app-release-" + "myapp" + ".apk";
            output.outputFile = new File('./', newName);
        }
    }

.yml文件:

dev:


script:
       - ./gradlew assembleDebug

 artifacts:
    name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
    paths:
         - app/*.apk

這解決了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM