judovana / jenkins-scm-koji-plugin

Using Koji/Brew as SCM for Jenkins
MIT License
2 stars 8 forks source link

Fake Koji SCM

Table of Contents

Fake Koji

Fake Koji serves as a storage for builds along with logs and source snapshots.

Naming Convention

Fake Koji uses Koji's NVRA (name, version, release, architecture):

SCP Upload

Default port: 9822

Supported cases for NVRA

Upload

scp ./dir/file user@host:nvra

scp ./dir/nvra user@host

scp ./dir/nvra user@host:/any_path/differentNvra

scp .dir/nvra user@host:/any_path/nvra

The uploaded file will be stored in user@host:/path_to_builds/n/v/r/a/. Note that in the last two cases the any_path, where the NVRA should be stored, is ignored.

Download:

scp user@host:nvra ./dir/

scp user@host:nvra ./dir/differentNvra

The downloaded file: ./dir/nvra.

Multiple upload and download

Works similarly:

scp ./dir/nvra1 ./dir/nvra2 user@host

scp user@host:nvra1 user@host:nvra2 ./dir

Supported cases for logs

Upload

scp ./dir/logFile user@host:nvra/log

scp ./dir/logFile user@host:nvra/log/newFile

The logFile will be stored in user@host:/path_to_builds/n/v/r/data/logs/a/

Download

scp user@host:nvra/log/logFile ./dir

scp user@host:nvra/log/logFile ./dir/newLogFile

The downloaded file: ./dir/logFile

Multiple upload and download

Works the same as single upload/download:

scp logFile1 logFile2 user@host:nvra/log

scp user@host:nvra1/log/logFile1 user@host:nvra2/log/logFile2 ./dir

Recursive upload

Having nvra1 and nvra2 in ./dir, then

scp -r ./dir user@host

will upload nvras to user@host:/path_to_builds/n1/v1/r1/a1 and user@host:/path_to_builds/n2/v2/r2/a2, respectively.

Having logFile1 and logFile2 in ./dir, then

scp -r ./dir user@host:nvra/logs

will upload both log files to user@host:/path_to_builds/n/v/r/data/logs/a/.

Having data1 and data2 in ./dir, then

scp -r ./dir user@host:nvra/data

will upload both files to user@host:/path_to_builds/n/v/r/data/

Recursive download

NVRA:

Recursive download of nvra works same as normal download. Multiple tarballs for one nvra is unlikely to be supported.

Logs:

scp -r user@host:nvra/logs ./dir

will download all logs for given nvra.

scp -r user@host:nvra/data/logs ./dir

and

scp -r user@host:nvra/data ./dir

are currently broken.

XML-RPC API

Default port: 9848

Part of Fake Koji is xml-rpc server compatible with Koji and Brew. You can get build information using these methods:

Curl API

You can get various information about Fake Koji's configuration and storage using its curl api.

Basic usage:

curl host/get?option:argument

Alternatively you can use url bar in your browser.

Options:

HTTP File Listing

Default port: 9849

Here you can browse Fake Koji's folder structure. There are three sections with same content but different sorting. The first one uses version sorting(last version on top), the second uses latest modified sorting(the latest modified file on top) and the last one uses latest modified directory content.

Folder structure

└── name
    └── version
        └── release
            ├── arch1
            │   └── name-version-release-arch1.tar.gz
            ├── arch2
            │   └── name-version-release-arch2.tar.gz
            ├── arch3
            │   └── name-version-release-arch3.tar.gz
            ├── data
            │   └── logs
            │       ├── arch1
            │       ├── arch2
            │       ├── arch3
            │       └── src
            └── src
                └── name-version-release-src.tar.gz

fakekoji-file-listing-01

fakekoji-file-listing-02

fakekoji-file-listing-03

fakekoji-file-listing-04

HTTP View

Default port: 80

This is the frontend of fake Koji. Here you can see the latest successful builds of every project. Projects are divided by their product. To see all builds of a project by clicking on project's details.

fake-koji-preview

fake-koji-preview-details

Jenkins SCM Koji Plugin

Next to Fake Koji there is Jenkins plugin, which ensures cooperation between Jenkins and Fake Koji. Based on configuration, plugin provides builds. -Dhudson.remoting.ClassFilter=hudson.plugins.scm.koji.model.Build,hudson.plugins.scm.koji.model.RPM,hudson.plugins.scm.koji.model.BuildProvider may be still necessary to add to jenkins start up.

Configuration

Configuration examples

koji-plugin-config-01

koji-plugin-config-02

Results package

After Jenkins jobs is finished, the plugin generates a page with results information. This page shows what specific build was used(name, version, release, NVR, tags), what RPMs or archives were downloaded, links and hash sums to this build can be also found here. If available, sources of build are included. jenkinks-plugin-result-page

Future goals