-
Notifications
You must be signed in to change notification settings - Fork 48
DevConf2020 Workshop
Tomas Tomecek edited this page Jan 25, 2020
·
14 revisions
A GitHub app and a CLI tool that helps you integrate your upstream project into Fedora OS and CentOS Stream.
-
Validate changes on your PR
- Can it be built in a distribution (fedora)
- Do the tests pass on the built package?
-
Automate the release process for Fedora packages
- sync upstream releases to downstream (e.g. automatically create a PR in Pagure-distgit)
- build in Fedora
-
more to come....
- packit tool - CLI
- Github Application - Packit-as-a-Service
- packages which have an RPM spec file
- custom commands/actions for creating archive, getting versions, patches, ...
- GitHub account
- the device with Internet access (..;)distgit
- you need a Fedora account with signed Fedora Project Contributor Agreement.
- Your project hosted on GitHub.
- You need to have or create a specfile. (Ask Jirka if you need some help.)
- Or a fork of your favourite project.
- Fork of the packit-service-testing-organisation/ogr project. (The final working version can be found on packit-service/ogr.)
- Fork of the packit-service/hello-world for very simple project.
- https://github.com/apps/packit-as-a-service
- -> install / configure
- choose the repo(s)
- Username matching FAS account whitelisted automatically.
- New issue in packit-service/notifications repository with manual whitelisting.
- https://packit.dev/docs/configuration/
- currently, no config => no packit-service action
- We are moving to the no-config scenario.
- dummy package (https://github.com/packit-service/hello-world):
specfile_path: hello.spec
upstream_package_name: hello
downstream_package_name: hello
jobs:
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-30-x86_64
- fedora-31-x86_64
- fedora-rawhide-x86_64
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-30-x86_64
- fedora-31-x86_64
- fedora-rawhide-x86_64
- job: propose_downstream
trigger: release
metadata:
dist-git-branch: fedora-all
- Simple python package (https://github.com/packit-service/ogr):
specfile_path: python-ogr.spec
upstream_package_name: ogr
downstream_package_name: python-ogr
upstream_project_url: https://github.com/packit-service/ogr
# the version is different than with basic git describe
create_tarball_command: ["python3", "setup.py", "sdist", "--dist-dir", "."]
current_version_command: ["python3", "setup.py", "--version"]
jobs:
- job: sync_from_downstream
trigger: commit
- job: propose_downstream
trigger: release
metadata:
dist-git-branch: fedora-all
- job: copr_build
trigger: pull_request
metadata:
targets: fedora-all
- job: tests
trigger: pull_request
metadata:
targets: fedora-all
- Python package using setuptools-scm for versioning (https://github.com/packit-service/packit)
specfile_path: packit.spec
synced_files:
- packit.spec
- .packit.yaml
- src: fedora-tests/
dest: tests/
# packit was already taken on PyPI
upstream_package_name: packitos
downstream_package_name: packit
upstream_project_url: https://github.com/packit-service/packit
actions:
create-archive:
- "python3 setup.py sdist --dist-dir ."
- "sh -c 'echo packitos-$(python3 setup.py --version).tar.gz'"
get-current-version:
- "python3 setup.py --version"
jobs:
- job: propose_downstream
trigger: release
metadata:
dist-git-branch: fedora-all
- job: sync_from_downstream
trigger: commit
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-all
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-stable # on rawhide we have problems with the new marshmallow
- custom actions (https://github.com/psss/tmt):
specfile_path: tmt.spec
synced_files:
- tmt.spec
upstream_project_name: tmt
downstream_package_name: tmt
current_version_command: ["make", "packit-version"]
actions:
create-archive:
- make packit-tarball
- make packit-path
jobs:
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-all
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-all
- clone the repository
- add the packit configuration file
- run
packit srpm
(works also for various refs)
$ packit srpm --help
Usage: packit srpm [OPTIONS] [PATH_OR_URL]
Create new SRPM (.src.rpm file) using content of the upstream repository.
PATH_OR_URL argument is a local path or a URL to the upstream git
repository, it defaults to the current working directory
Options:
--output FILE Write the SRPM to FILE instead of current dir.
--remote TEXT Name of the remote to discover upstream project URL, If
this is not specified, default to origin.
--upstream-ref TEXT Git ref of the last upstream commit in the current
branch from which packit should generate patches (this
option implies the repository is source-git).
-h, --help Show this message and exit.
- You can add also URL as an argument:
$ packit srpm https://github.com/packit-service/ogr
Packit 0.8.1.dev36+g5856e95 is being used.
Input is a URL to a git repo: https://github.com/packit-service/ogr
Input directory is an upstream repository.
SRPM is /tmp/python-ogr-0.9.1.dev20+g8f89fe2-1.fc31.src.rpm
SRPM: /tmp/python-ogr-0.9.1.dev20+g8f89fe2-1.fc31.src.rpm
$ packit srpm https://src.fedoraproject.org/rpms/python-ogr
Packit 0.8.1.dev36+g5856e95 is being used.
Input is a URL to a git repo: https://src.fedoraproject.org/rpms/python-ogr
Input directory is a downstream repository.
SRPM is /tmp/python-ogr-0.9.1.dev20+g8f89fe2-1.fc31.src.rpm
SRPM: /tmp/python-ogr-0.9.1.dev20+g8f89fe2-1.fc31.src.rpm
- Check the status of the package in various places:
$ packit status https://src.fedoraproject.org/rpms/packit
Packit 0.8.1.dev36+g5856e95 is being used.
Input is a URL to a git repo: https://src.fedoraproject.org/rpms/packit
WARNING 'upstream_project_name' configuration key was renamed to 'upstream_package_name', please update your configuration file
Input directory is a downstream repository.
ERROR Failed when getting Copr builds: There is no config file: /home/flachman/.config/copr
No downstream PRs found.
Dist-git versions:
f30: 0.8.1
master: 0.7.1
f29: 0.7.1
f31: 0.8.1
Upstream releases:
0.8.1
0.8.0
0.7.1
0.7.0
0.6.1
Latest Bodhi updates:
Update Karma status
------------------- ------- --------
packit-0.8.1-1.fc30 2 testing
packit-0.8.1-1.fc31 3 stable
packit-0.7.1-1.fc30 1 stable
Latest Koji builds:
fc31: packit-0.8.1-1.fc31
fc30: packit-0.8.1-1.fc30
fc29: packit-0.6.1-1.fc29
fc32: packit-0.7.1-1.fc32
No Copr builds found.