Uso de Travis CI para probar en scripts de shell UNIX
Antecedentes:
He estado usando Travis CI para mis proyectos PHP y realmente me gusta cómo te dan un enlace a una imagen que muestra el estado de la compilación actual de tu proyecto.
Actualmente estoy haciendo muchas herramientas usando UNIX shell scripting y me gustaría usar Travis CI para probar mis scripts UNIX.
He buscado en internet tratando de averiguar cómo lograr esto. Fui a la página web principal, buscó Stackoverflow, así como hizo un poco de Búsqueda en Google.
Parece Que esto no es posible.
Actualmente uso shunit2 para probar mis scripts y funciones de shell.
Mi(s) pregunta (s) es (n):
- ¿Es posible usar Travis CI para probar scripts de shell?
- Si no hay alguna alternativa que podría usar ese plug en GitHub?
- ¿Cuál es la mejor manera de realizar pruebas de integración en scripts de shell?
3 answers
Absolutamente.
Hice una simple prueba aquí: https://travis-ci.org/soulseekah/test-shunit2-travis
Mi archivo .travis.yml
es:
language: bash
before_script:
- curl -L "http://downloads.sourceforge.net/shunit2/shunit2-2.0.3.tgz" | tar zx
script:
- bash equality_test.sh
Repositorio: https://github.com/soulseekah/test-shunit2-travis
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-12-08 06:35:15
Metí todo en un Makefile y luego llamé a make test
...
language: bash
script: make test
Estoy usando assert.sh , así que no había necesidad de before_script
. Puede comprobarlo en https://github.com/wmluke/dokku-domains-plugin .
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-27 08:17:26
Si necesita la última versión de shUnit2, es posible que necesite obtenerla de la rama maestra.
Lo tengo trabajando así:
---
language: bash
before_script: "sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2"
script: "bash shunit2/test_example.sh"
Ver también mi ejemplo shunit2 repo aquí.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-18 05:39:12