Skip to content

Instantly share code, notes, and snippets.

@nuchyobitva
Last active April 16, 2018 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuchyobitva/1cfc7f2a1a8cfac19d35e1a6f1faa9b9 to your computer and use it in GitHub Desktop.
Save nuchyobitva/1cfc7f2a1a8cfac19d35e1a6f1faa9b9 to your computer and use it in GitHub Desktop.
lab05

Laboratory work V

Данная лабораторная работа посвещена изучению систем непрерывной интеграции на примере сервиса Travis CI

$ open https://travis-ci.org

Tasks

  • 1. Авторизоваться на сервисе Travis CI с использованием GitHub аккаунта
  • 2. Создать публичный репозиторий с названием lab05 на сервисе GitHub
  • 3. Ознакомиться со ссылками учебного материала
  • 4. Включить интеграцию сервиса Travis CI с созданным репозиторием
  • 5. Получить токен для Travis CLI с правами repo и user
  • 6. Получить фрагмент вставки значка сервиса Travis CI в формате Markdown
  • 7. Установить Travis CLI
  • 8. Выполнить инструкцию учебного материала
  • 9. Составить отчет и отправить ссылку личным сообщением в Slack

Tutorial

$ export GITHUB_USERNAME=<имя_пользователя>
$ export GITHUB_TOKEN=<полученный_токен>
$ cd ${GITHUB_USERNAME}/workspace
$ pushd .
$ source scripts/activate
$ \curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles
$ echo "source $HOME/.rvm/scripts/rvm" >> scripts/activate
$ rvm autolibs disable
$ rvm install ruby-2.4.2
$ rvm use 2.4.2 --default
$ gem install travis
$ git clone https://github.com/${GITHUB_USERNAME}/lab04 projects/lab05
$ cd projects/lab05
$ git remote remove origin
$ git remote add origin https://github.com/${GITHUB_USERNAME}/lab05
$ cat > .travis.yml <<EOF
language: cpp
EOF
$ cat >> .travis.yml <<EOF

script:
- cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
- cmake --build _build
- cmake --build _build --target install
EOF
$ cat >> .travis.yml <<EOF

addons:
  apt:
    sources:
      - george-edison55-precise-backports
    packages:
      - cmake
      - cmake-data
EOF
$ travis login --github-token ${GITHUB_TOKEN}
$ travis lint
$ ex -sc '1i|<фрагмент_вставки_значка>' -cx README.md
$ git add .travis.yml
$ git add README.md
$ git commit -m"added CI"
$ git push origin master
$ travis lint
$ travis accounts
$ travis sync
$ travis repos
$ travis enable
$ travis whatsup
$ travis branches
$ travis history
$ travis show

Report

$ popd
$ export LAB_NUMBER=05
$ git clone https://github.com/tp-labs/lab${LAB_NUMBER} tasks/lab${LAB_NUMBER}
$ mkdir reports/lab${LAB_NUMBER}
$ cp tasks/lab${LAB_NUMBER}/README.md reports/lab${LAB_NUMBER}/REPORT.md
$ cd reports/lab${LAB_NUMBER}
$ edit REPORT.md
$ gistup -m "lab${LAB_NUMBER}"

Links

Copyright (c) 2017 Братья Вершинины
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment