New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start CI pipeline on Travis CI #15

Merged
merged 2 commits into from Oct 27, 2017

Conversation

Projects
None yet
2 participants
@MoriTanosuke
Contributor

MoriTanosuke commented Oct 24, 2017

Trying to implement #12.

I started a build pipeline on Travis. In my branch I added a simple .travis.yml with a couple of settings matching the project.

Unfortunately there is a gradle task which tries to run an emulator, which is not fully supported (see https://docs.travis-ci.com/user/languages/android/#How-to-Create-and-Start-an-Emulator).

Execution failed for task ':FDAndroidClient:connectedDebugAndroidTest'.
> com.android.builder.testing.api.DeviceException: No connected devices!

Maybe you can use it anyway, or disable the gradle task for CI builds. There is also a way to upload build artifacts to Github Releases, documentation at https://docs.travis-ci.com/user/deployment/releases/ I started to use this in another project of mine, but it needs some private set up, so I can only give some tips if you get stuck.

If you have any questions, feel free to ask in the comments. 馃槃

@mcicolella

This comment has been minimized.

Show comment
Hide comment
@mcicolella

mcicolella Oct 24, 2017

Contributor

@MoriTanosuke any tip for uploading build artifact is welcome.

Contributor

mcicolella commented Oct 24, 2017

@MoriTanosuke any tip for uploading build artifact is welcome.

@MoriTanosuke

This comment has been minimized.

Show comment
Hide comment
@MoriTanosuke

MoriTanosuke Oct 25, 2017

Contributor

First you have to make sure that your build is successful on Travis. Maybe you have to skip the emulator tests or modify the project to make them run on the Travis emulator. I have not done this before yet, so I can't help with this. If it's an absolute requirement to run the emulator and you can not make it work with Travis, you might have to use a different CI provider, like CloudBees.

For Travis, you have to provide your own Github OAuth token, read about it here https://docs.travis-ci.com/user/deployment/releases/#authenticating-with-an-oauth-token

Here's a short description of the steps to update the .travis.yml for releases:

  1. install the travis command line client https://github.com/travis-ci/travis.rb#installation
  2. run travis setup releases in the project directory, this should add the deploy section to .travis.yml
  3. modify the deploy section to match the artifact you want to deploy:
deploy:
  provider: releases
  api-key: "GITHUB OAUTH TOKEN"
  file: "build/path/to/your/file.jar"
  skip_cleanup: true
  on:
    tags: true
Contributor

MoriTanosuke commented Oct 25, 2017

First you have to make sure that your build is successful on Travis. Maybe you have to skip the emulator tests or modify the project to make them run on the Travis emulator. I have not done this before yet, so I can't help with this. If it's an absolute requirement to run the emulator and you can not make it work with Travis, you might have to use a different CI provider, like CloudBees.

For Travis, you have to provide your own Github OAuth token, read about it here https://docs.travis-ci.com/user/deployment/releases/#authenticating-with-an-oauth-token

Here's a short description of the steps to update the .travis.yml for releases:

  1. install the travis command line client https://github.com/travis-ci/travis.rb#installation
  2. run travis setup releases in the project directory, this should add the deploy section to .travis.yml
  3. modify the deploy section to match the artifact you want to deploy:
deploy:
  provider: releases
  api-key: "GITHUB OAUTH TOKEN"
  file: "build/path/to/your/file.jar"
  skip_cleanup: true
  on:
    tags: true
@MoriTanosuke

This comment has been minimized.

Show comment
Hide comment
@MoriTanosuke

MoriTanosuke Oct 25, 2017

Contributor

I updated my .travis.ymlwith an example and enabled release uploads in my repository. Have a look at this build for an example, the uploaded release is here. The sourcecode is attached by Github whenever you create a release, the files FDAndroidClient-release-unsigned.apk and FDAndroidClient-debug.apk are uploaded by Travis.

Contributor

MoriTanosuke commented Oct 25, 2017

I updated my .travis.ymlwith an example and enabled release uploads in my repository. Have a look at this build for an example, the uploaded release is here. The sourcecode is attached by Github whenever you create a release, the files FDAndroidClient-release-unsigned.apk and FDAndroidClient-debug.apk are uploaded by Travis.

@mcicolella

This comment has been minimized.

Show comment
Hide comment
@mcicolella

mcicolella Oct 27, 2017

Contributor

@MoriTanosuke Sorry for delay. You made a great work! If you update your branch to fix a conflict about .gitignore I can merge this PR and then update the files with our Travis configuration.
Thanks a lot.

Contributor

mcicolella commented Oct 27, 2017

@MoriTanosuke Sorry for delay. You made a great work! If you update your branch to fix a conflict about .gitignore I can merge this PR and then update the files with our Travis configuration.
Thanks a lot.

@MoriTanosuke

This comment has been minimized.

Show comment
Hide comment
@MoriTanosuke

MoriTanosuke Oct 27, 2017

Contributor

@mcicolella Rebased and resolved.

Contributor

MoriTanosuke commented Oct 27, 2017

@mcicolella Rebased and resolved.

@mcicolella mcicolella merged commit c49218b into freedomotic:master Oct 27, 2017

@MoriTanosuke MoriTanosuke deleted the MoriTanosuke:ci-pipeline branch Nov 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment