-
Notifications
You must be signed in to change notification settings - Fork 4
Home
To automate building Vale, you can use the Copr - Github integration. Every time you push commit to the repository, Copr starts an RPM build. Consequently, to automate building Vale RPM, you must automate:
- Checking and committing the latest version to the
vale.spec
file. - Configure Copr - Github integration.
This text assumes that you have forked this repository.
The RPM build relies on the version in the vale.spec file. This repository contains the automation directory, which automates synchronizing the version with the upstream release version.
To set up the automation script:
- Create a Python virtual environment in a directory of your choice.
In this example, the virtual env is in the
automation
directory.
cd /path/to/vale-spec/automation
python3 -m venv .venv
- Source the virtual environment and install the automation script dependencies.
. .venv/bin/activate
pip install -r requirements.txt
- Ensure that the script is executed periodically.
You can achieve this, for example, by using crontab.
Execute
crontab -e
and add the following entry:
0 * * * * /path/to/repo/vale-spec/automation/.venv/bin/python3 /path/to/repo//vale-spec/automation/main.py
This means that crontab executes the main.py
automation script every hour.
Copr is the build environment that can download an RPM spec file and execute a build.
To configure a project:
-
Create an account at https://copr.fedorainfracloud.org
-
Create a project. Select the build options that you want to support. Vale is a single binary, so it should work on any
x86_64
Linux distribution. See https://copr.fedorainfracloud.org/coprs/mczernek/vale/ for information about the most used build options. Important: You must enable theEnable internet access during builds
option. -
In your project, click
packages
and define yourvale
package. Use your fork repository URL in theclone URL
field. Usevale.spec
in thepath to .spec file
field. Important: You must enable theAuto-rebuild the package? (i.e. every commit or new tag)
option. Create that package. -
Click
settings -> integrations
and copy the first Github URL, for examplehttps://copr.fedorainfracloud.org/webhooks/github/1234/abcdef...ghijk/
. -
Open your vale-spec fork, for example
https://github.com/m-czernek/vale-spec
, and clicksettings
. -
Click
webhooks -> add webhook
. -
Paste the URL from step 5. Configure the
content type
toapplication/json
and clickadd webhook
.
You should now have a working automation. When github.com/errata-ai/vale contains a new release, the next hour that your laptop is on, crontab executes the script, which updates the vale.spec
file.
Then, Github sends a webhook request to Copr to rebuild the Vale package.
Links about RPM packaging: