I need to publish the build artifacts(.apk files) to a cloud server. Could someone please help me to do the configuration.
It might help to know what kind of cloud server you have. I upload my artifacts to a Github release using ghr.
Here is my circle.yml (relevant line highlighted):
Thanks for the response. I am very new to Continuous Integration. I woul like to post my artifacts to the GitHub. Could you please explain me the parameters in the statement to publish to GitHub.
Publish assets to Github
- ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME v1.0.$CIRCLE_BUILD_NUM $CIRCLE_ARTIFACTS/ || true
My circle.yml file is
general:
artifacts:
- /home/ubuntu/$PROJECT_NAME/app/build/outputs/apk/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
ANDROID_NDK_HOME: /usr/local/android-ndk
dependencies:
cache_directories:
- ~/.android
- ~/android
pre:
- if ! $(grep -q âRevision=23.0.2â $ANDROID_HOME/tools/source.properties); then echo y | android update sdk -u -a -t âtoolsâ; fi
- if [ ! -e $ANDROID_HOME/build-tools/23.0.2 ]; then echo y | android update sdk -u -a -t âbuild-tools-23.0.2â; fi
test:
override:
- ./gradlew dependencies
- ./gradlew assembleRelease
Well, ghr is actually this tool: https://github.com/tcnksm/ghr Itâs got a pretty good set of documentation. All the other parameters are environment variables built in to CircleCI. You can find them in their documentation here: https://circleci.com/docs/environment-variables/
Itâs important to understand the $CIRCLE_ARTIFACTS environment variable points to where your artifacts should be. When you create your artifacts, put them there. Theyâll appear in the âartifactsâ tab at the end of the build.
Also, my build script happens to use the $CIRCLE_ARTIFACTS location as the âsourceâ location for ghr. Make sense?
I have tried and but the files are not published to the github. But the release version is getting generated in github. I am not sure where it is getting wrongâŚ
- ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME v1.0.$CIRCLE_BUILD_NUM $artifacts/ || true
â> Uploading: nohup.out
upload nohup.out error: failed to open file: nohup.out
Thanks dear⌠I have configured the $CIRCLE_ARTIFACTS properly⌠and everything works perfect⌠http://stackoverflow.com/questions/37244768/circleci-publish-the-artifacts-to-a-cloud-server⌠You can post your answer in stackoverflow as wellâŚ