The exercises are built on top of each other which means you need to e.g. finish exercise one before you can start working on exercise two. If you stuck with one exercise you can look at the linked answer. We will use the OBS reference installation on build.opensuse.org which requires you to create an account.
-
Create a GitHub repository with a simple script in it, which prints
Hello World
to the console -
Create a package in your build.opensuse.org home project
-
The package should contain a spec file which installs your
Hello World
script to/bin
- https://en.opensuse.org/openSUSE:Build_Service_Tutorial
- Answer
- Bonus task: Make the package build for various distributions and architectures
-
The package should contain a
_service
file, which fetches the sources from the GitHub repository you've created in the previous step -
Connect your GitHub repository with OBS to let GitHub trigger a package build, whenever a new commit has been pushed to master
- You can create a security token with
osc token
- You can install
osc
for various distributions from this repository - You can add a GitHub webhook in your repository via
Settings -> Integrations & services
- You can create a security token with
-
Create a new appliance from a template on build.opensuse.org
- There is an Open Source Summit example template, select this one
-
Add your
Hello World
package to the appliance- Either use the kiwi image editor view (
Edit Kiwi
) or edit thekiwi.xml
file - You need to add your
home
project repository and theHello World
package to your appliance - https://doc.opensuse.org/projects/kiwi/doc/#sec.description.repository
- https://doc.opensuse.org/projects/kiwi/doc/#sec.description.packages
- Answer
- Either use the kiwi image editor view (
-
Add a
root
and atux
user to your appliance -
Add the
apache2
package and make sure that apache gets started automatically- You can enable services in the
config.sh
script - You can start the apache2 webserver via
systemctl enable apache2
- https://doc.opensuse.org/projects/kiwi/doc/#ref.kiwi.config.sh
- Answer
- You can enable services in the
-
Add a simple
Hello World
html file to your apache2 webserver- Kiwi uses a directory called
root
to store the root tree of your new image. Add your files in a directory namedroot
. - The root directory needs to be archived as tar.gz file (
tar -zcvf tar-archive-name.tar.gz source-folder-name
) - The html files need to go into
/srv/www/htdocs
- Answer
- Kiwi uses a directory called
-
Bonus task: Download and run your appliance with QEMU / VirtualBox and test, if everything works as expected