Travis CI

  • Travis-CI๋Š” ๋ฃจ๋น„๋กœ ์ž‘์„ฑ๋œ ์˜คํ”ˆ ์†Œ์Šค ๊ธฐ๋ฐ˜์˜ CI(Continuous Integration)
  • ๋ถ„์‚ฐ CI ํ˜ธ์ŠคํŒ… ์„œ๋น„์Šค๋ฅผ ์ œ๊ณต
  • GitHub ์•„์ด๋””์˜ ํ”„๋กœ์ ํŠธ๋ฅผ ์—ฐ๊ฒฐํ•˜์—ฌ ํ…Œ์ŠคํŠธ, ๋นŒ๋“œ ๋ฐ ๋ฐฐํฌ ๊ฐ€๋Šฅ

Getting Started

1. ํ”„๋กœ์ ํŠธ Forkํ•˜๊ธฐ

2. Travis-CI ํšŒ์›๊ฐ€์ž…ํ•˜๊ธฐ

3. Github Repositories ์—‘์„ธ์Šค ๊ถŒํ•œ ํ™œ์„ฑํ™” ์‹œํ‚ค๊ธฐ

4. .travis.yml ํ™•์ธํ•˜๊ธฐ

{% highlight yml %} language: php php:

  • 5.5

  • 5.4

  • hhvm script: phpunit Test.php {% endhighlight %}

  • .travis.yml์„ ํ†ตํ•ด Travis-CI์—๊ฒŒ ์•Œ๋ ค์ค๋‹ˆ๋‹ค.

  • ํ”„๋กœ์ ํŠธ๋Š” PHP๋กœ ์ž‘์„ฑ๋˜์—ˆ๊ณ  PHP versions 5.5, 5.4, HHVM์ธ phpunit์„ ํ†ตํ•ด Test.php๋ฅผ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ผ๊ณ  ์•Œ๋ ค์ค๋‹ˆ๋‹ค.

5. NewUser.txt์— ์ด๋ฆ„ ๋„ฃ๊ณ  Pushํ•˜์—ฌ Travis CI ์ž‘๋™์‹œ์ผœ๋ณด๊ธฐ

  • ์ด๋ฆ„ ์ž‘์„ฑํ•˜๊ธฐ

  • Git Push ํ•˜๊ธฐ

{% highlight git %} git commit -m โ€˜Testing Travis CIโ€™ $ git push {% endhighlight %}

Travis only runs a build on the commits you push after adding the repository to Travis.

  • Travis CI๋Š” Email๋กœ Test ๊ฒฐ๊ณผ๋ฌผ์„ ๋ณด๋‚ธ๋‹ค.

6. Test.php ์ˆ˜์ •ํ•˜๊ณ  Pushํ•˜์—ฌ Travis CI ์ž‘๋™์‹œ์ผœ๋ณด๊ธฐ

  • Test.php ์ˆ˜์ •ํ•˜๊ธฐ

  • Git Push ํ•˜๊ธฐ

{% highlight git %} git commit -m โ€˜Testing Travis CI: fixing the buildโ€™ $ git push {% endhighlight %}

Reference