본문 바로가기
카테고리 없음

travis-ci

by Younji! 2019. 3. 27.

travis-ci와 github 연동





여러 CI가 있지만 소규모의 개발자로 빠르게 적용하고 추가 리소스가 발생하지 않은데 굉장히 효율적인 상용 CI를 사용하기로 했다. 
비교적 간단한 스크립트와 빠르고..! 순차적으로 결과를 확인할 수 있는 장점이 있으므로 적용하였다.

거두절미하고 travis-ci 에 github repository를 연동을 해보자.


Generate SSH Key 


personal access token로 repository 에 SSH 키를 발급한다. 
travis login --pro # travis login
travis sshkey --generate -r {organization}/{repository} # ssh generate ssh key


Add .travis.yml

travis.yml yml 파일을 프로젝트 트리 상단에 위치시켜 빌드
language: java
jdk:
  - openjdk8
branches:
  only:
    - master
cache:
  directories:
    - $HOME/.gradle/caches
    - $HOME/.gradle/wrapper
 
before_cache:
  rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  rm -fr $HOME/.gradle/caches/*/plugin-resolution/
 
notifications:
  slack: token

간단하게 CI 를 구성할 수 있다. 

자세한 document는 https://docs.travis-ci.com/ 를 참고하면 되겠다.


주의 ) Note that before_deploy and after_deploy are run before and after every deploy provider, so will run multiple times if there are multiple providers.



댓글