/workshop-obs-ci

Exercises for the workshop for the openSUSE conference. Topic: Continuous Integration with the Open Build Service

Exercises:

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 answer in the according branch (exercise-#number).

  1. Create a GitHub repository with a simple script in it which prints Hello World to the console

  2. Create a package in your build.opensuse.org home project

  3. The package should contain a spec file which installs your Hello World script to /bin

  4. The package should contain a _service file which fetches the sources from the GitHub repository you created in the previous step

  5. Connect your GitHub repository with OBS in order to let GitHub trigger a build if a new commit has been pushed to master

    • You can create a security token with osc token
    • You can add a GitHub webhook in your repository via Settings -> Integrations & services
  6. Create a new appliance in your build.opensuse.org home project by copy over the config.xml and config.sh files from the exercise-6 branch.

  7. Add your Hello World package to the appliance

  8. Add a root and a tux user to your appliance

  9. Add the apache2 package and make sure that apache gets started automatically

  10. Add the postgresql94-server and pgadmin3 package to your appliance and make sure that the postgressql server gets started automatically

  11. Add a simple Hello World html file to your apache2 webserver

    • You should add the files to the /root directory
    • The root directory needs to be a tar.gz file (tar -zcvf tar-archive-name.tar.gz source-folder-name)
    • The html files need to go into /srv/www/htdocs
    • Answer
  12. Add a postgresql database dump to the /tmp directory

    • You should add the files to the /root directory
    • The root directory needs to be a .tar.gz file (tar -zcvf tar-archive-name.tar.gz source-folder-name)
    • Temporarely store them in in the /tmp directory and import them automatically
    • You need to extract the dvdrentar.zip file before you can import it in the database
    • You can import a database dump with su postgres -c "psql -q < /tmp/dvdrental/restore.sql 2>&1"
    • Answer
  13. Bonus Question: Download and run your appliance with QEMU / VirtualBox and test if everything works as expected