2016-08-15 106 views
0

我在我的項目的根有一個「.gitlab-ci.yml」文件:配置gitlab CI爲Android項目

job_build_debug_apk: 
    script: 
    - ./gradlew assembleRelease 
    stage: deploy 
tags: 
    - android 
allow_failure: true 

,而我推到主,將建立並succesed,但我可以在我的項目中找到任何apk文件。

這是我的日誌:

running with gitlab-ci-multi-runner 1.4.2 (bcc1794) 
Using Shell executor... 
Running on userMacBook-Pro.local... 
Fetching changes... 
Removing .gradle/ 
Removing app/build/ 
Removing build/ 
HEAD is now at 3ae32fc back back 
From http://gitlab.xxx.com/naiyu/AdminYDT 
    3ae32fc..5312eaa master  -> origin/master 
Checking out 5312eaaf as master... 
$ ./gradlew assembleRelease 
Starting a new Gradle Daemon for this build (subsequent builds will be faster). 
Incremental java compilation is an incubating feature. 
:app:preBuild UP-TO-DATE 
:app:preReleaseBuild UP-TO-DATE 
:app:checkReleaseManifest 
:app:preDebugBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library 
:app:prepareComAndroidSupportAppcompatV72340Library 
:app:prepareComAndroidSupportSupportV42340Library 
:app:prepareComAndroidSupportSupportVectorDrawable2340Library 
:app:prepareReleaseDependencies 
:app:compileReleaseAidl 
:app:compileReleaseRenderscript 
:app:generateReleaseBuildConfig 
:app:mergeReleaseShaders 
:app:compileReleaseShaders 
:app:generateReleaseAssets 
:app:mergeReleaseAssets 
:app:generateReleaseResValues 
:app:generateReleaseResources 
:app:mergeReleaseResources 
:app:processReleaseManifest 
:app:processReleaseResources 
:app:generateReleaseSources 
:app:incrementalReleaseJavaCompilationSafeguard 
:app:compileReleaseJavaWithJavac 
:app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 
:app:compileReleaseNdk UP-TO-DATE 
:app:compileReleaseSources 
:app:lintVitalRelease 
:app:prePackageMarkerForRelease 
:app:transformClassesWithDexForRelease 
To run dex in process, the Gradle daemon needs a larger heap. 
It currently has approximately 910 MB. 
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. 
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties. 
For more information see https://docs.gradle.org/current/userguide/build_environment.html 
:app:mergeReleaseJniLibFolders 
:app:transformNative_libsWithMergeJniLibsForRelease 
:app:processReleaseJavaRes UP-TO-DATE 
:app:transformResourcesWithMergeJavaResForRelease 
:app:packageRelease 
:app:assembleRelease 

BUILD SUCCESSFUL 

Total time: 32.012 secs 
Build succeeded 

我的亞軍執行是Shell在我的Mac OS。

有沒有我的路徑有問題,或者是否有任何博客顯示這一點。

+1

此文章由Snapchat的Android開發人員編寫,可能會幫助您:https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/ 他解釋瞭如何使用GitLab CI構建和測試Android應用程序,爲'.gitlab-ci.yml'提供所需的代碼,並將其分解成若干部分,逐一解釋。 –

+1

@ martijn-pieters我只是想幫忙,而且你沒有給我時間來編輯我的答案。這太不公平了。 –

回答

1

Gitlab CI的工作原理是這樣的:您的push更改爲服務器,您的本地亞軍制作clone(或pull)您的最新更改。

來源將被下載到跑步者的子文件夾中,而不是在您的項目中。這意味着apk也會在其中一個子文件夾中。

+0

謝謝,我已經找到了你所說的apk。現在我已經改變了默認的構建路徑。 – naiyu