Skip to content

balena-io-experimental/balena-travis-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

resin-travis-test It builds!

Continuous Integration on your devices:

Deploy to resin.io from Github using Travis CI.

Description

This repo is a simple example on how to use Travis CI to push code to your devices on resin.io. The travis.yml file specifies the script that "builds" the project - in this case, the build consists in adding the Resin git remote and pushing to it. This will trigger the build in Resin's servers and deploy the code to your devices.

The script could, of course, be modified to include tests, other builds or whatever you need for your own project. Pushing different branches to different apps (if you have a staging app, for instance), could easily achieved by adding git push commands to different remotes.

Configuration

The travis.yml file uses just two environment variables: RESIN_REMOTE and RESIN_DEPLOY_KEY. This can be set in the Travis Settings page for the repo.

RESIN_REMOTE is just the ssh address of the Resin git remote, e.g. gh_pcarranzav@git.resin.io:gh_pcarranzav/supertestrpi.git.

RESIN_DEPLOY_KEY should be a private SSH key so that Travis can push to Resin. You can generate the key like this:

ssh-keygen # Will prompt for a file name, input one like 'id_rsa'
echo -n "\""; cat id_rsa | awk 1 ORS='\\n'; echo "\""

This last command will print the SSH key in a format that can be inputted in the Travis Settings GUI, that is, between quotes and with newlines replaced by "\n" (a slash followed by an n, not the newline character).

The public key should then be added on the Resin dashboard.

This could alternatively be done by using Travis' file encryption feature.

About

Deploy to resin.io from GitHub using Travis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published