{"id":21273316,"url":"https://github.com/sclorg/rhscl-container-ci","last_synced_at":"2025-07-11T06:33:18.617Z","repository":{"id":46865188,"uuid":"61114864","full_name":"sclorg/rhscl-container-ci","owner":"sclorg","description":"This repository contains scripts and jenkins job configuration for testing RHSCL container images.","archived":false,"fork":false,"pushed_at":"2021-09-22T07:20:21.000Z","size":252,"stargazers_count":0,"open_issues_count":5,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-07-02T19:07:23.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sclorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-14T10:45:40.000Z","updated_at":"2021-09-22T07:20:25.000Z","dependencies_parsed_at":"2022-08-23T16:10:30.436Z","dependency_job_id":null,"html_url":"https://github.com/sclorg/rhscl-container-ci","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Frhscl-container-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Frhscl-container-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Frhscl-container-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Frhscl-container-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sclorg","download_url":"https://codeload.github.com/sclorg/rhscl-container-ci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225700924,"owners_count":17510448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T09:13:30.561Z","updated_at":"2024-11-21T09:13:31.312Z","avatar_url":"https://github.com/sclorg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI Tests for Container Images Based on Red Hat Software Collections\n\nThis directory contains job configuration files, managed through [Jenkins Job\nBuilder](http://ci.openstack.org/jenkins-job-builder/), to run tests for each\nContainer Image based on Red Hat Software Collections.\n\nCurrent list of tested images can be found in [Github team\nrepositories](https://github.com/orgs/sclorg/teams/container-images/repositories)\nor in [configuration file](./configuration).\n\nNow tests are run in two Jenkins instances:\n* [CentOS CI](https://ci.centos.org/view/SCLo-images/)\n\n  - jobs to test Pull Requests (test CentOS based variants of images)\n\n  - JJB configuration file `jenkins_jobs.ini`\n\n* Non-public Jenkins server (to know more ask hhorak@redhat.com)\n  - jobs to test Pull Requests (test RHEL based variants of images)\n\n  - jobs to build CentOS based variants of images on every new commit and\n  push them to [Docker Hub](https://hub.docker.com/u/centos/)\n\n  - JJB configuration file `jenkins_jobs_rhscl.ini`\n\nAll scripts, which are used by this repo, are stored in alone repository\n[ci-scripts](https://github.com/sclorg/ci-scripts), so we do not update Jenkins CI\nby each change. `ci-scripts` repository is cloned by each task in Jenkins CI.\n\n## Pre-requisites\n\nTo use scripts in this repository to update jobs in Jenkins you need:\n\n* `virtualenv` command, supplied through the `python-virtualenv` RPM\n\nJJB will be installed into a virtual environment under this directory, so is\nsafe to run on any system.\n\n## Updating all jobs\n\nThe provided script can update the Jenkins jobs over the API by running JJB.\n\n    ./run.sh update\n\nTo access Jenkins using JJB you have to provide configuration file. So if\nfiles `jenkins_jobs.ini` and `jenkins_jobs_rhscl.ini` don't exist they are\ncreated from a template. Then add the username/password for access to Jenkins, edit\nURL in `jenkins_jobs_rhscl.ini` and then re-run the command.\n\nNote: [SCLo-sig](https://wiki.centos.org/SpecialInterestGroup/SCLo)\ncredentials for [ci.centos.org](ci.centos.org) can be found in the home\ndirectory on slave01.ci.centos.org.\n\n## Using run.sh\n\n`run.sh` is simple wrapper for `jenkins-jobs` command. It supports `update`,\n`test` and `delete` commands. And according specified name prefix of jobs it\nselects right configuration file and adds `-r $THISDIR/yaml` to specify path\nfor commands.\n\nTo test the configuration of one job, run:\n\n    ./run.sh test rhscl-images-ruby-rh\n    echo $?\n\nOnce happy with the result, to test your config change on a single job, run:\n\n    ./run.sh update rhscl-images-ruby-rh\n\nDuring updating jobs you can select jobs by globbing. For example to update\njobs configured for CentOS CI run\n\n    ./run.sh update SCLo-*\n\nor to update the RHEL related jobs in different jenkins instance run\n\n    ./run.sh update rhscl-*\n\n## Generating jobs\n\nProject files for each Software Collection Docker image in folder\n`./yaml/jobs/collections/` can be generated by running `./run.sh`. If project\nfile for some line in [configuration\nfile](https://github.com/sclorg/rhscl-container-ci/blob/master/configuration)\ndoes not exist, it is generated by substituting values to\n[template](https://github.com/sclorg/rhscl-container-ci/blob/master/yaml/jobs/collections/template).\nEach line of this file has format: \"name namespace github_org github_project\ntriggering_project\".\n\nBy default each project has these three jenkins jobs generated:\n\n* *SCLo-container-{name}-{namespace}*: job which tests content of pull\nrequests in CentOS7. It requires to run on [CentOS CI\ninfrastructure](https://ci.centos.org)).\n\n* *rhscl-images-{name}-{namespace}*: job which tests content of pull requests\nin RHEL7. This job is *not* configured to use CentOS CI infrastructure and it\nrequires to run on machine with access to RHEL7 Docker image.\n\n* *rhscl-images-{name}-{namespace}-build*: job which after new commit to\nrepository builds CentoOS7 based image and pushes it to Docker Hub. This job\nis *not* configured to use CentOS CI infrastructure.\n\n**Projects do not have to use all three default jobs. Some files in\n`./yaml/jobs/collections/` can be manually created/updated. So be careful when\nregenerating all project files.**\n\nFor regenerating all project files (if you really know what you do; see a comment above), run:\n```\nrm yaml/jobs/collections/*yaml\n./run test\n```\n\n## How to add tests for a new image\n\nWhen a new image is created and we want to add testing of it. Push/move image repository into `https://github.com/sclorg` organization. To enable CI:\n\n1. Create jenkins job - the easiest way is to add a new entry to `./configuration` \nfile and run `./run.sh` (missing project files are generated):\n\n    `./run.sh update`\n\n    Then a PR should include `./configuration` and the newly created file\n    `./yaml/jobs/collections/\u003cnewspec\u003e`.\n\n2. In order to allow testing of the pull-requests, right permissions have be set. Add the **'centos-ci'** user as a collaborator to the repo and add the repository to **'Container images'** github team - both with **write** access.\n\n3. To be able to trigger CentOS CI jobs add webhook for github repository:\n\n    Payload URL : `https://ci.centos.org/ghprbhook/`\n\n    Choose `'Let me select individual events.'` and mark notifications for\n    `'Issue comment'` and `'Pull request'`.\n\n4. If the repository is supposed to be maintaned (write/admin permissions) only by people from RedHat, add the repository to **'RedHat maintained'** github team. There is a jenkins job which check permissions for all repositories listed there.\n\n## Branches in this repo\n\nThis repository contains three important branches\n* `old_jenkins` - which did not use `ci-scripts` repository and Jenkins CI did not use OpenShift at all.\n* `ocp3_jenkins` - which uses `ci-scripts` repository with branch `ocp3_jenkins` and Jenkins CI use OpenShift 3 and configuration is done as Configuration as a Code.\n* `master` - which uses `ci-scripts` repository with branch `master` and Jenkins CI use OpenShift 4 and configuration is done as Configuration as a Code.\n\n## Creating necessary credentials in Jenkins\n\n**Jenkins jobs need permissions to access github pull-requests for two reasons:**\n\nA) Update the status of the pull-request\n\nB) Creating a gist file to share the job log, that is otherwise available behind a firewall only; and updating generated branch\n\nAll credentials, tokens and configurations are now hidden in secret repo.\nOur Jenkins CI is now configured as Configuration as a Code.\nFor access to this repo, ask pkubat@redhat.com, hhorak@redhat.com or phracek@redhat.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Frhscl-container-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsclorg%2Frhscl-container-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Frhscl-container-ci/lists"}