#3 Fix Style and Syntax
Closed 5 years ago by tjzabel. Opened 5 years ago by tjzabel.
fedora-docs/ tjzabel/remix-building update-summary  into  master

Update style. Fix summary.
Tim Zabel • 5 years ago  
Fix wording.
Tim Zabel • 5 years ago  
Fix #1. Update flow of text.
Tim Zabel • 5 years ago  
file modified
+56 -39
@@ -1,79 +1,96 @@ 

  [[automated-build-system-for-remixes-without-koji]]

  = Automated Build System For Remixes Without Koji

  

- The overall setup is described below. You should have a separate web

- server and build host. This is due to the possibility of the ISO build

- process to destroy the host system it is running on.

+ This document hopes to outline the process of creating an automated RPM and ISO

+ building infrastructure for smaller 

+ https://fedoraproject.org/wiki/Remix[Fedora Remix] projects that do not make 

+ use of Fedora's Koji ecosystem. 

  

  [[basic-setup]]

  == Basic Setup

  

- The web server is a CentOS system that hosts public ISO downloads and

- the package repository. It is provisioned using `playbook.yml` in this repo.

+ It is best practice to keep the web server and builder separate.

  

- The builder is a Fedora system provisioned using `playbook-builder.yml` 

- in this repo. It is a Jenkins CI server and automatically rebuilds RPMs 

- as changes are made in version control. The automation should be 

- configured in Jenkins to trigger on a push to `master` for each repo 

- housing package sources.

+ The web server is a CentOS system. It's main purpose is to host the public ISO 

+ downloads and package repository. The

+ https://pagure.io/fedora-docs/remix-building/blob/master/f/playbook-mirror.yml[playbook-mirror.yml] 

+ Ansible playbook located in this repository automates the provisioning of the 

+ web server. 

+ 

+ The builder is a Fedora system provisioned using the 

+ https://pagure.io/fedora-docs/remix-building/blob/master/f/playbook-builder.yml[playbook-builder.yml] 

+ Ansible playbook. The builder is a Jenkins CI server which rebuilds RPMs when 

+ changes are made in the version control. The automation should be configured 

+ in Jenkins to trigger on a push to `master` for each repo housing package 

+ sources.

  

  [[RPMs]]

  == RPMs

  

- A template for the Jenkins job is below.

+ The series of commands shown below illustrate the process of building RPM

+ packages with Jenkins. 

  

  ....

  sudo rm -rf /home/$USER/to-sign/

  mkdir -p /home/$USER/to-sign/

- copr-rpmbuild scm --clone-url [URL of git repo with package source] --chroot fedora-$(lsb_release -a|grep Release|cut -f2)-x86_64 

+ copr-rpmbuild scm --clone-url [URL of git repo with package source] --chroot \

+ fedora-$(lsb_release -a | grep Release | cut -f2)-x86_64 

  sudo cp /var/lib/copr-rpmbuild/results/*.rpm /home/$USER/to-sign

  rm -rf /var/lib/copr-rpmbuild/results

  ....

  

- A notification is then sent to IRC, Slack or email that the build has

- completed and the responsible team member connects to the build server

- via SSH and runs the command below.

+ Once the RPM build finishes, a responsible team member then needs to connect 

+ to the build server via SSH in order to sign the completed RPM package using:

  

  `sudo rpmsign --addsign /path/to/to-sign/directory/*rpm`

  

- They then `rsync` the new packages to the mirror and after verifying

- permissions run:

+ A tool such as `rsync` should then be used to push the new packages to 

+ the mirror. After verifying the permissions are correct, run:

  

  `sudo createrepo --update /path/to/RPMs or SRPMs`

  

- on the mirror.

+ on the mirror in order to update the proper RPM repository.

  

  [[ISOs]]

  == ISOs

  

- ISOs should be built as needed using the following sequence of commands.

- This can optionally be automated if the process is stable and triggers

- reliably.

- 

- The process requires the packages `lorax-lmc-novirt` and `pykickstart`

- installed on the host system.

- 

- ....

- setenforce 0

- livemedia-creator --ks tigeros.ks --no-virt --resultdir /var/lmc --project [remix name]-Live --make-iso --volid [remix name] --iso-only --iso-name [remix name].iso --releasever $vers --title [remix name]-live --macboot

- setenforce 1

- ....

+ ISOs should be built as needed. In order to build an ISO, you need two 

+ prerequisites:

  

- In order to build the ISO, you need to create a kickstart file to be used by the Anaconda installer to create the image.

+ . A kickstart file when building an ISO using the

+ https://fedoraproject.org/wiki/Anaconda[Anaconda Installer]

+ . The `lorax-lmc-novirt` and `pykickstart` Fedora packages

  

- Detailed instructions for creating an ISO for a remix are below.

+ === Initial ISO Building

  

- . Clone the Fedora kickstarts repository: `git clone https://pagure.io/fedora-kickstarts.git`

- . Enter the directory: `cd fedora-kickstarts`

+ . Clone the Fedora Kickstarts repository: `git clone https://pagure.io/fedora-kickstarts.git`

+ . Enter the directory: `cd fedora-kickstarts/`

  . Choose a kickstart to use as a base for your remix

  . Flatten the kickstart: `ksflatten --config [name of kickstart].ks -o flat-[name of kickstart].ks --version [fedora version]`

- . Edit the `%packages` section of the flat kickstart

- . Set `selinux` to permissive: `sudo setenforce 0`

+ . Edit the `%packages` section of the flat kickstart if you wish to add/remove

+ base packages

+ . Set `SELinux` to permissive with: `sudo setenforce 0`

  . Run `livemedia-creator`: 

  

+     sudo livemedia-creator --ks /path/to/flat/kickstart/file --no-virt \

+     --resultdir /var/lmc --project [image name] --make-iso --volid [image name] \

+     --iso-only --iso-name [image name].iso --releasever [fedora release] \

+     --title [image name] --macboot

+ 

+ . The resulting ISO will be in `/var/lib/lmc`. 

+ . Finally, set `SELinux` back to enforcing: `sudo setenforce 1` 

+ 

+ === General ISO Building

+ 

+ After an initial ISO build, a new ISO may be created by running:

+ 

  ....

- sudo livemedia-creator --ks /path/to/flat/kickstart/file --no-virt --resultdir /var/lmc --project [image name] --make-iso --volid [image name] --iso-only --iso-name [image name].iso --releasever [fedora release] --title [image name] --macboot

+ setenforce 0

+ livemedia-creator --ks [kickstart-name].ks --no-virt --resultdir /var/lmc \

+ --project [remix name]-Live --make-iso --volid [remix name] \

+ --iso-only --iso-name [remix name].iso --releasever $vers \

+ --title [remix name]-live --macboot

+ setenforce 1

  ....

  

- . The resulting ISO will be in `/var/lib/lmc`

- . Set `selinux` back to enforcing: `sudo setenforce 1` 

+ You may want to consider automating the ISO build with Jenkins.

no initial comment

Pull-Request has been closed by tjzabel

5 years ago
Metadata