Skip to content

Commit

Permalink
initial support for using Jenkins CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 19, 2016
1 parent 9cd0dfe commit ddd1d08
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
@@ -1 +1 @@
service_name: travis-ci
service_name: jenkins-ci
31 changes: 0 additions & 31 deletions .gitignore
@@ -1,38 +1,7 @@
*.ami
*.la
*.lo
*.m4
*.pot
package/*.bz2
stamp-h*
aclocal.m4
autodocs-cc.ami
autodocs-cc-base.ami
autodocs-cc-off.ami
autodocs-ycp.ami
autom4te.cache
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.ac
/coverage/
/doc/
install-sh
libtool
ltconfig
ltmain.sh
Makefile
/Makefile.am
Makefile.am.common
Makefile.in
missing
mkinstalldirs
pluglib-bindings.ami
/nbproject/
test-driver
.yardoc/
13 changes: 13 additions & 0 deletions .spell.yml
@@ -0,0 +1,13 @@
# This is the repository specific custom dictionary
#
# Write the words in alphabetical order, one word per line.
# If an unknown word is generic put it into the global dictionary
# in yast-rake in lib/tasks/spell.yml file.

---
ignore:
- "doc/**/*"
- "coverage/**/*"
dictionary:
- SLE
- SMT
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
YaST - Registration Module
========================

[![Travis Build](https://travis-ci.org/yast/yast-registration.svg?branch=master)](https://travis-ci.org/yast/yast-registration)
[![Build Status](http://ci.opensuse.org/buildStatus/icon?job=yast-registration-github-ci)](http://ci.opensuse.org/view/Yast/job/yast-registration-github-ci/)
[![Coverage Status](https://img.shields.io/coveralls/yast/yast-registration.svg)](https://coveralls.io/r/yast/yast-registration?branch=master)
[![Code Climate](https://codeclimate.com/github/yast/yast-registration/badges/gpa.svg)](https://codeclimate.com/github/yast/yast-registration)
[![Inline docs](http://inch-ci.org/github/yast/yast-registration.svg?branch=master)](http://inch-ci.org/github/yast/yast-registration)
Expand All @@ -13,6 +13,6 @@ This is a YaST module for registering a SUSE Linux Enterprise (SLE) product to
The module is a part of SLE product installation or upgrade workflow.

A registered system will receive security updates and the functionality of the
system can be extented via online extensions or modules.
system can be extended via online extensions or modules.

See the wiki pages (https://github.com/yast/yast-registration/wiki) for more details.
28 changes: 27 additions & 1 deletion package/yast2-registration.spec
Expand Up @@ -56,6 +56,14 @@ BuildRequires: yast2-slp >= 3.1.2
BuildRequires: yast2-packager >= 3.1.26
BuildRequires: yast2-update >= 3.1.19

# Install extra packages for running additional tests at the Jenkins CI builds.
# run manually: osc build --define "run_ci_tests 1"
# from sources: rake osc:build['--define "run_ci_tests 1"']
%if 0%{?run_ci_tests}

This comment has been minimized.

Copy link
@mvidner

mvidner Feb 4, 2016

Member

I think it is slightly better to use %bcond_with, as in https://github.com/yast/yast-core/pull/105/files#diff-5ada80d590698e14cfda5a88dce9f4c9

BuildRequires: rubygem(yast-rake-ci)
%endif


BuildArch: noarch

Summary: YaST2 - Registration Module
Expand All @@ -76,7 +84,25 @@ Authors:
%build

%check
rake test:unit
%if 0%{?run_ci_tests}
LC_ALL=en_US.UTF-8 \
COVERALLS_REPO_TOKEN='%{coveralls_repo_token}' \
CI_PULL_REQUEST='%{ci_pull_request}' \
JENKINS_URL='%{jenkins_url}' \
BUILD_URL='%{build_url}' \
GIT_BRANCH='%{git_branch}' \
GIT_COMMIT='%{git_commit}' \
GIT_ID='%{git_commit}' \
GIT_AUTHOR_NAME='%{git_author_name}' \
GIT_AUTHOR_EMAIL='%{git_author_email}' \
GIT_COMMITTER_NAME='%{git_commiter_name}' \
GIT_COMMITTER_EMAIL='%{git_commiter_email}' \
GIT_MESSAGE='%{git_message}' \

This comment has been minimized.

Copy link
@mvidner

mvidner Feb 4, 2016

Member

This is strange. Are these substituted by RPM build, like other percent macros in the spec file? Where are they defined.

This comment has been minimized.

Copy link
@lslezak

lslezak Feb 4, 2016

Author Member

These options are passed from the Jenkins script (see https://ci.opensuse.org/view/Yast/job/yast-registration-github-push/configure).

They are needed for Coveralls support. Coveralls reads the Git commit metadata directly from the Git checkout, but in this case we are running inside an RPM build and the sources are built from a tarball so there is no way how to get the Git commit data directly.

Fortunately Coveralls allows passing the metadata via environment, otherwise we could not use it inside RPM build...

This comment has been minimized.

Copy link
@mvidner

mvidner Feb 4, 2016

Member

Yes, I see why the values are useful.
But I wanted to object to the obscurity of the value passing mechanism, and now that I see the implementation, also to putting anything more than 3 lines to the Jenkins "Build command" text area :)
Ideally Jenkins should say

. coveralls_git_defines_from_env
rake osc:build["$COVERALLS_GIT_DEFINES"]

and the spec should encapsulate it in a RPM macro too

export %coveralls_git_env_from_defines
rake check:ci

This comment has been minimized.

Copy link
@lslezak

lslezak Feb 5, 2016

Author Member

Thanks for the suggestion, that would be much better. The current implementation is rather a proof of concept, it was quite tricky to find a solution...

COVERAGE=1 CI=1 \
rake --verbose --trace check:ci
%else
rake test:unit
%endif

%install
rake install DESTDIR="%{buildroot}"
Expand Down
2 changes: 1 addition & 1 deletion test/spec_helper.rb
Expand Up @@ -2,7 +2,7 @@
require "simplecov"

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
if ENV["TRAVIS"] || ENV["COVERALLS_REPO_TOKEN"]
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
Expand Down

0 comments on commit ddd1d08

Please sign in to comment.