GithubHelp home page GithubHelp logo

optionalg / jenkins-rpm-publish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spohnan/jenkins-rpm-publish

0.0 2.0 0.0 204 KB

An RPM containing scripts to assist with publishing RPMs built by jenkins to a yum repository

License: Other

Shell 100.00%

jenkins-rpm-publish's Introduction

jenkins-rpm-publish

An RPM containing scripts to assist with publishing RPMs build by jenkins to a yum repository hosted from a local Apache web server

Usage

The example below uses jenkins-rpm-build.rpm and this jenkins-rpm-publish capability to build an rpm and publish to a locally hosted yum repository. This snippet would be copied into the Execute Shell text area available after adding the additional build step.

# Settings
RPM_VERSIONS_TO_KEEP=3
RPM_REPO_BASE=/var/www/html/repos/centos/6/custom
RPM_NAME=jenkins-rpm-publish-*.rpm

# Build and publish
jenkins-build-rpm.sh
jenkins-publish-rpm.sh $RPM_REPO_BASE/x86_64 RPMS/noarch $RPM_NAME $RPM_VERSIONS_TO_KEEP
jenkins-publish-rpm.sh $RPM_REPO_BASE/SRPMS SRPMS $RPM_NAME $RPM_VERSIONS_TO_KEEP

Another finishing step once the publishing functionality has been configured would be to create custom repo config files for clients looking to use rpm builds from this build service. The example below is from the build server itself so it is using a localhost URL. The key setting is the metadata_expire immediately setting which allows clients to immediately pick up a build using yum update instead of relying on metadata for several hours which is the default setting.

[root@build-01 ~]# cat /etc/yum.repos.d/Custom-RPMs.repo
[custom-rpms]
name=Custom RPMs
baseurl=http://localhost/repos/centos/6/custom/x86_64/
enabled=1
gpgcheck=0
metadata_expire=0

A final build idea for RPM projects like this one that have a shunit2 based test suite is to add a second Execute shell step above the build that looks something like the example below to run the tests.

# Remove any old artifacts so they don't get archived with this build
rm -f RPMS/noarch/*.rpm SRPMS/*.rpm

# Run test suite
TESTS/run-tests.sh

Download

Download source rpm or binary (noarch) rpm for CentOS 6

Building

Clone this project into PROJECT_DIR

git clone https://github.com/spohnan/jenkins-rpm-publish.git

Build the RPM

rpmbuild \
    --define "release `date +%Y%m%d%H%M%S`" \
    --define "_topdir $PROJECT_DIR/jenkins-rpm-publish" \
    -ba SPECS/jenkins-rpm-publish.spec

jenkins-rpm-publish's People

Contributors

spohnan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.