Skip to content

12 Travis CI

i-rochiño edited this page Jan 9, 2017 · 5 revisions

https://travis-ci.org/

Continuous Integration, often abbreviated to just CI, is the process of automatically building and running tests whenever a change is committed. Travis CI is a continuous integration platform which watches for you to commit code to your GitHub repository and then runs your code on an external server to test and even deploy it for you.

Como teño o meu repo en github.io e de cando en vez subo modificacións. Pode que haxa erros no código (ligazóns inexistentes ou cousas así). Xusto cando fago git push é cando Travis analiza o código e avisa se atopa faios.

Paseniño:

  • Doume de alta en https://travis-ci.org/ xa recoñece o meu github e trae a lista de repositorios ó meu: perfil: https://travis-ci.org/profile/irocho no meu caso.

  • Activo o interruptorcito do repo no que quero a axuda de Travis

  • Vou ó Terminal e fago un git push

  • Na páxina build de Travis indica os erros e tamén envía un correo: non teño _.travis.yml_e tampouco un Gemfile axeitado. Busco por internet.

Aconsellados por esta páxina

O ficheiro Gemfile precisa engadir:

source 'https://rubygems.org'
gem "jekyll"
gem 'github-pages'
gem 'html-proofer'

.travis.yml estará na raíz e terá a pinta:

language: ruby
rvm:
  - 2.2.5
script:
  - bundle exec jekyll build
  - bundle exec htmlproofer ./_site --only-4xx --check-favicon --check-html
env:
  global:
    - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false # route your build to the container-based infrastructure for a faster build

This will build your site into _site on the Travis server and then run HTML proofer on the generated HTML.

Outra idea pode ser crear a carpeta script e engadir o que vai arriba. Paso.

EHHHHH peta por todo... non puxen alt= nas imaxes Puuuf!!!

Deshabilitar travis

Se quero deshabilitar travis podo poñer nos commit: (entre corchetes)

git commit -m "cambios menores [ci skip]"

https://jekyllrb.com/docs/continuous-integration/ Moi chula [https://www.raywenderlich.com/109418/travis-ci-tutorial](esta explicación para XCode e Pull Request)