diff --git a/PACKAGING.md b/PACKAGING.md new file mode 100644 index 0000000..6da1a26 --- /dev/null +++ b/PACKAGING.md @@ -0,0 +1,83 @@ +# Packaging + +This is a guide for creating Debian packages for ceo. The instructions below +probably do not follow best practices, but at least I am confident that they +work. + +## Prerequisites +Make sure your GPG key is in /srv/debian/gpg on potassium-benzoate. See +[here](https://wiki.csclub.uwaterloo.ca/Debian_Repository#Step_1:_Add_to_Uploaders) +for instructions. + +## Creating the package +Use Docker/Podman to avoid screwing up your main system. +For example, to create a package for bullseye: +```sh +podman run -it --name pyceo-packaging -v "$PWD":"$PWD" -w "$PWD" debian:bullseye bash +``` +**Important**: Make sure to use a container image for the same distribution which you're packaging. +For example, if you're creating a package for bullseye, you should be using the debian:bullseye +Docker image (this is because the virtualenv symlinks python to the OS' version of python). + +Here are some of the prerequisites you'll need to build the deb files +(run this inside the container): +```sh +apt install devscripts debhelper git-buildpackage +``` +Make sure to also install all of the packages in the 'Build-Depends' section in debian/control. + +Update VERSION.txt to the next version, and do a git commit. + +Now run `dch -i` and edit the changelog. + +Now you will build a signed package. Place your key ID after the `-k` argument, e.g. +```sh +gbp buildpackage --git-upstream-branch=master -k8E5568ABB0CF96BC367806ED127923BE10DA48DC +``` +This will create a bunch of files (deb, dsc, tar.gz, etc.) in the parent directory. + +Now do another git commit (since you edited the changelog file). + +To clean the packages: +```sh +rm ../*.{xz,gz,dsc,build,buildinfo,changes,deb} +``` + +## Uploading the package +Inside the container, go up one directory, and create a tarball with all the package files: +``` +cd .. +tar zcvf pyceo.tar.gz *.{xz,gz,dsc,build,buildinfo,changes,deb} +``` +Outside of the container (i.e. on your personal machine), copy the tarball out of the +container into your current directory, e.g. +``` +podman cp pyceo-packaging:/home/max/repos/pyceo.tar.gz . +``` +(Replace `/home/max/repos` by the directory in the container with the tarball.) +Now upload the tarball to a CSC machine, e.g. +``` +scp pyceo.tar.gz mannitol:~/ +``` +SSH into that machine and extract the tarball into a separate directory: +``` +ssh mannitol +mkdir pyceo-parent +mv pyceo.tar.gz pyceo-parent/ +cd pyceo-parent +tar zxvf pyceo.tar.gz +``` +At this point, you will need a dupload.conf file. Ask someone on syscom for a copy. + +Now upload the package to potassium-benzoate: +``` +kinit +dupload *.changes +``` + +Now SSH into potassium-benzoate and run the following: +``` +sudo /srv/debian/bin/rrr-incoming +``` + +There, that wasn't so bad...right? :') diff --git a/README.md b/README.md index 70e426d..d7e6150 100644 --- a/README.md +++ b/README.md @@ -224,47 +224,4 @@ curl --negotiate -u : --service-name ceod --delegation always \ ``` ## Packaging -First, I strongly recommend running the build in a Docker/Podman -container to avoid screwing up your main system: -```sh -podman run -it --name pyceo-packaging -v "$PWD":"$PWD" -w "$PWD" debian:buster bash -``` -**Important**: Make sure to use a container image for the same distribution which you're packaging. -For example, if you're creating a package for bullseye, you should be using the debian:bullseye -Docker image (this is because the virtualenv symlinks python to the OS' version of python). - -Here are some of the prerequisites you'll need to build the deb files: -```sh -apt install devscripts debhelper git-buildpackage -``` -Make sure to also install all of the packages in the 'Build-Depends' section in debian/control. - -There are two important files to change before creating a new package: debian/changelog -(which can be edited by running `dch -i`), and VERSION.txt. - -Make sure you git commit your changes *before* building the packages. - -To build unsigned packages: -```sh -gbp buildpackage --git-upstream-branch=master -uc -us -``` - -To build signed packages (for uploading), you need to have your GPG key ready, and it should also -be in the CSC mirror keyring. -Once you have done that, replace '-uc -us' by '-k', e.g. -```sh -gbp buildpackage --git-upstream-branch=master -k8E5568ABB0CF96BC367806ED127923BE10DA48DC -``` -This will create a bunch of files (deb, dsc, tar.gz, etc.) in the parent directory. - -To clean the packages: -```sh -rm ../*.{xz,gz,dsc,build,buildinfo,changes,deb} -``` - -### Uploading -Ask a syscom member for their dupload.conf file, and place it in your ~/.dupload.conf. -Then, from a CSC machine, upload the changes file from the parent directory, e.g. -``` -dupload ceo_1.0.0-buster1_amd64.changes -``` +See [PACKAGING.md](./PACKAGING.md). diff --git a/debian/changelog b/debian/changelog index 51097af..40fdc81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ceo (1.0.15-bullseye1) bullseye; urgency=medium + + * Use binary search when searching for the next UID. + * Fix bug in expireMembers which retrieved non-member LDAP records. + + -- Max Erenberg Sat, 25 Dec 2021 16:49:34 +0000 + ceo (1.0.14-buster1) buster; urgency=medium * Add Kubernetes API endpoint.