Непрерывная интеграция с помощью Travis CI

Post on 21-Jan-2018

106 views 2 download

transcript

TRAVIS - CI, CDL, CDP

1

3

Артем Соковец Руководитель направления Research and Development

AVSokovets.SBT@sberbank.ru

https://github.com/artsok

СОДЕРЖАНИЕ

4

o Continuous Integration/CDL/CDP

o Travis CI

o Travis Types

o Supported Languages

o Getting Started

o Build Lifecycle

o Configuration File

o Build Status

o Build History

o Third-Party Integration

o Examples

o More CI Services

o QA

CI/CDL/CDP

5

TRAVIS CI

6

Travis CI — распределённый веб-сервис для сборки тестирования программного обеспечения, использующий GitHub в качестве хостинга исходного кода.

TRAVIS CI

7

TURN ON

8

TRAVIS TYPES

9

Travis-ci.org Travis-ci.comopen-source projects closed-source projects

SUPPORTED LANGUAGES

10

Programming Languages: goo.gl/RhzBjy

VIRTUALIZATION ENVIRONMENTS

11

BUILD LIFECYCLE

12

apt addons

cache components

before install

install

install: install any dependencies required

before script

script

before cache

after success/after failure

script: run the build script

before deploy

deploy

after deploy

after script

deploy: load to server

CONFIGURATION FILE

13

Определяем язык и версию

Определяем переменные окружения

Подключаем интеграцию с Sauce Labs

Определяем СУБД

Запуск pre-steps

Запуск основного скрипта

Определяем ветку source

Определяем провайдера и api_tokensдля авторизации

BUILD STATUS

14

BUILD HISTORY

15

Integrate badge to GitHub project

EXAMPLES: SELENIUM TEST

17

language: java

sudo: false

dist: trusty

addons:

firefox: latest

apt:

packages:

- google-chrome-stable

before_script:

- export DISPLAY=:99.0

- sh -e /etc/init.d/xvfb start &

- sleep 3

script:

- mvn test

EXAMPLES: JDI

18

language:

java

jdk:

- oraclejdk8

sudo: false

script:

- mvn clean -f ./Java/pom.xml

- mvn compile -f ./Java/pom.xml

notifications:

email: false

addons:

apt:

packages:

- oracle-java8-installer

EXAMPLES: DEPLOY TO MAVEN CENTRAL

19

language: java

sudo: false

dist: trusty

addons:

sonarcloud:

organization: "artsok-github"

token:

secure: $SONAR_TOKEN

cache:

directories:

- '$HOME/.m2/repository'

jdk:

- oraclejdk8

script:

- mvn test sonar:sonar

deploy:

- provider: script

script: ".travis/deploy.sh"

on:

repo: artsok/rerunner-jupiter

branch: master

- provider: script

script: ".travis/deploy.sh"

skip_cleanup: true

on:

repo: artsok/rerunner-jupiter

tags: true

MORE CI SERVICES

20

QA

21

Артем Соковец AVSokovets.SBT@sberbank.ru

github.com/artsok/travic-test

https://goo.gl/02JHuy

http://goo.gl/UUSytn

github.com/sbtqa