Skip to content

Example to build with Copr for Ruby on Rails recipe

Jun Aruga edited this page Apr 28, 2017 · 8 revisions

This document is to show an example to build with Copr example with actual command lines.

The Users Guide tutorial [1] document's concept is for people to learn how to use on bird eyes step by step, reading it. This document's concept is to show actual command example accurately for people to reproduce that easily.

Download

$ git clone git@github.com:sclorg/rpm-list-builder.git
$ git clone git@github.com:sclorg/rhscl-rebuild-recipes.git
$ cd rpm-list-builder

Install

Refer README.md [2] section to install rpmlb.

Run

Create working directory

Create working directory before running rpmlb with --work-directory. Use --work-directory option in this case.

$ mkdir -p $HOME/tmp/rpmlb_work_dir

Setting for Copr

Create copr repository "rh-ror50-test" on Copr. Create new project. This page [3] is my project for that on Fedora Copr. Basically same setting with that.

Update Settings -> 2. Build options
  Chroots -> epel-7-x86_64 -> packages: scl-utils-build rh-ruby23-scldevel rh-ror50-build
  External repositories: http://mirror.centos.org/centos/7/sclo/x86_64/rh/ 

Create Copr configuration file (= I describe it as $COPR_CONFIG_FILE) for copr-cli command. You can get the content of the file from somewhere of the Internal Copr web site.

  • ${HOME}/.config/copr (for the case of Fedora Copr and fedpkg) or
  • ${HOME}/.config/copr-internal (for the case of Internal Copr and rhpkg)
$ cat $COPR_CONFIG_FILE 
[copr-cli]
login = nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
username = your_account_name
token = nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
copr_url = your_copr_repo_url
# expiration date: 2017-10-09

Build with rpmlb command!

Activate Kerberos login for fedpkg or rhpkg. Use below custom file (I describe the custom file as $CUSTOM_FILE) in this case.

  • tests/fixtures/custom/fedpkg_copr.yml (for the case of Fedora Copr and fedpkg) or
  • tests/fixtures/custom/rhpkg_internal_copr.yml (for the case of Internal Copr and fedpkg)

Let's run.

$ rpmlb \
  --download custom \
  --build custom \
  --custom-file $CUSTOM_FILE \
  --work-directory $HOME/tmp/rpmlb_work_dir \
  ../rhscl-rebuild-recipes/ror.yml \
  rh-ror50 2>&1 | tee rpmlb.log

rpmlb starts downloading packages at first. You can check created directories under the working directory.

$ ls $HOME/tmp/rpmlb_work_dir
001/  008/  015/  022/  029/  036/  043/  050/  057/  064/  071/  078/  085/  092/  099/
002/  009/  016/  023/  030/  037/  044/  051/  058/  065/  072/  079/  086/  093/  100/
003/  010/  017/  024/  031/  038/  045/  052/  059/  066/  073/  080/  087/  094/  101/
004/  011/  018/  025/  032/  039/  046/  053/  060/  067/  074/  081/  088/  095/  102/
005/  012/  019/  026/  033/  040/  047/  054/  061/  068/  075/  082/  089/  096/  103/
006/  013/  020/  027/  034/  041/  048/  055/  062/  069/  076/  083/  090/  097/  104/
007/  014/  021/  028/  035/  042/  049/  056/  063/  070/  077/  084/  091/  098/  105/

After downloading, rpmlb starts building packages. You may fail to build for some reasons. In that case, you can resume from any position of packages. Sample is a case to resume from 012's package build. Take note that --download option are removed to run building only on below command.

$ rpmlb \
  --build custom \
  --custom-file $CUSTOM_FILE \
  --work-directory $HOME/tmp/rpmlb_work_dir \
  --resume 12 \
  ../rhscl-rebuild-recipes/ror.yml \
  rh-ror50 2>&1 | tee rpmlb.log