We have recently moved our code to GitHub, and we support a local development environment using Vagrant – which means, that collaboration have never been easier. Even if you’re very new to the world of open source, this might be a good place for you to start. For example, an easy fix of a typo might be a great opportunity for you to make your first open source contribution!
What is Copr?
Copr is a community build service in Fedora that builds your code and provides you with your own RPM repository.
So, if you are a developer, you can build your application in Copr and make it available for everyone. Or you might be packager – a person, who creates packages of open source software, which are easy to install in Fedora. Then you have two options:
- Make the package a part of the Fedora distribution using Fedora Packaging Guidelines. If your package passes a review and all the formal requirements, the package will be added to Fedora and you will become an owner of the package. This means, that you will be responsible for making updates and reporting issues to the upstream, or fixing them. You will become an appreciated member of the Fedora community!
- Build the package in Copr. This option requires less commitment, and it is also suitable for testing or quick and dirty solutions. In fact, it’s totally up to you to decide the quality of your packages and how often you will update them. Copr is a build service for everyone. Learn more about using Copr.
Local development environment with Vagrant
Vagrant can create a local development environment on your workstation. It is very easy to use and will not break your environment, as it installs everything in virtual machines.
Starting the environment
$ git clone https://github.com/fedora-copr/copr.git $ cd git $ vagrant up
This spawns two virtual machines on your workstation:
- Copr Frontend – including the web interface and database – http://localhost:5000
- Copr Dist Git – storage for the source code – http://localhost:5001
(optional) If you want to start only one specific virtual machine, run one of these commands:
$ vagrant up frontend $ vagrant up distgit
Testing your changes
To test your changes, commit them to your local repository and reload the virtual machines.
$ git add . $ git commit -m "changed something really important" $ vagrant reload frontend
This will restart the Copr Frontend virtual machine, rebuild your package and install it.
Accessing the virtual machines
If you need to access the virtual machines, you can use either:
$ vagrant ssh frontend $ vagrant ssh distgit
Rebuilding broken virtual machines
Have you destroyed one of the machines completely? That’s fine! To delete it and install it again from the scratch, use:
$ vagrant destroy frontend $ vagrant up frontend
You can do the same for distgit as well.
Stopping the virtual machines
$ vagrant halt
Now, when you know what Copr is, how to make changes, and you maybe did some experiments, you are ready to change the world! Well, make a pull-request to the Copr project.
You should also familiarize yourself with pull-requests. You will need to:
And that’s it! If you have any questions about Copr, contributing, or anything related to this article, please leave a comment in the comment section below. I’m looking forward to hear from you!