Ever wondered what goes on behind the magic of Fedora Badges? How does a badge go from being a design to an earn-able entity? This short but handy guide breaks down the entire process for you. This post is adapted from a series of notes I took while watching Ralph Bean demo the procedure at PyCon. This guide is a supplement, not a replacement, for the official Badges SOP.
Badges Prerequisites
Before beginning to consider whether you are going to push a badge, you must first meet the following prerequisites.
- Clone the
badges
repository, where all badges live. - Be a sponsored member of the
sysadmin-badges
FAS group
Taking care of art assets
Before publishing the badge, you will need to make sure all the art assets are in the right place for the ticket. This usually consists of a PNG and SVG, but can also include an STL file for 3D printing a badge design.
The following steps are a handy checklist of things you need to do for gathering all the art assets together.
- Go to the ticket for the badge and pull both art asset types (PNG and SVG) into the
badges
repository. If there is a YAML rule file, pull that down as well. - Place both art assets (and YAML file, if applicable) into their appropriate folder. Make sure both files share the same name. It is preferred to name the files the name of the badge for easy indexing later on.
- Double-check to make sure the image assets you pulled down are “good” – sometimes the images can be corrupted and this can cause problems later. Check if you can view both files.
- Change directories into
bin/
and run theexport.sh
script. This will create an STL file for the badge and move it in the right place for you. Check theREADME
file inbin/
for more info about running the script. - Add the files in git and commit. If you have push privileges, go ahead and push. If not, create a patch file and add it to the original badge ticket.
At this point, all the art assets will now be prepared and ready for deployment.
Pushing out badges
Once you have committed the badge to the FedoraHosted repository, it doesn’t mean the badge is “out there” yet. To do this, you will need to use an Ansible playbook for that purpose.
These steps will take you to the Batcave and have you push the badge out to the Badges front-end, Tahrir.
- Log into the
batcave
machine and find thepush-badges.yml
playbook. Execute it.- Note that you will need to have proper privileges to execute and run the playbook. Sysadmins with privileges (
sysadmin-badges
FAS group) will be able to run the playbook to pull the changes from FedoraHosted tobatcave
– the changes then get synced to thebadges-web
server. - If you are only a member of
sysadmin-badges
but not other groups, you can use therbac-playbook
tool to execute this specific playbook. For more information on role-based-access-control playbooks, read the original announcement.
- Note that you will need to have proper privileges to execute and run the playbook. Sysadmins with privileges (
- Wait for the playbook to finish. Once complete, check if the PNG file is publicly viewable on the Badges website.
https://badges.fedoraproject.org/pngs/{{ badge_name }}.png
Now, the hard work is done. From this point, you will have to use the front-end of Tahrir to finish adding the badge.
Adding badges from Tahrir
Once the art assets are on badges-web
, you will be ready to make the badge. But be warned! Creating a badge is easy, but editing it is not! Make sure the information you are entering is right on the first go. Otherwise, fixing it will involve fixing the data with SQL statements.
- Log into the admin interface on badges.fedoraproject.org.
- Go to the “Add badge” section.
- Enter in all the information as provided in the badge ticket. Make sure to include the right name, description, and location of the image file. Once you have double-checked and verified the information is correct, hit “Create badge“.
- Tags are an important part of this process too. Compare to other similar badges when adding a new one, otherwise it may not be categorized correctly in the badges index.
- Some information is consistent across all badges, like the Badge Criteria field. For this field, you should always put the link back to the original Badges Team ticket where the badge was proposed, designed, and discussed.
- If the badge does not have an automatic rule for being awarded, you will need to grant authorizations for issuing the badge. You can do this at the bottom of the admin interface. Use the badge name and the @fedoraproject.org email for the person gaining privileges.
After pushing the badge out, do some last checks to make sure the badge pushed correctly. Make sure the page is viewable and double-check that it’s categorized correctly in the badge index. If everything looks right, you should be finished.
Congratulations, you just pushed your very own Fedora Badge!
Image courtesy Anna Dziubinska – originally posted to Unsplash as Untitled.
Nice one! Thanks for sharing 🙂
Cheers, glad you enjoyed it!
Nice article 😀
FYI you need not give credit to image that are in public domain 🙂
Thanks, glad you liked it! Hopefully others will find this info useful.
I didn’t know Unsplash was CC0 until now, actually. However, it’s such a small and easy thing to do, I don’t mind giving credit for amazing artwork and graphics that make it easy for me to create things like the fancy images. 🙂