Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update packaging scripts to build in Docker #119

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

palpant-dbx
Copy link
Contributor

@palpant-dbx palpant-dbx commented Mar 15, 2023

This change reworks the packaging scripts to build inside Docker, since we can no longer build for both Ubuntu and Fedora on an Ubuntu machine.

  • Dockerfiles for bare Ubuntu, Debian, Debian (i386) and Fedora images are added with necessary build dependencies
  • Two new build scripts are created to replace build_packages.py:
    • build_packages.sh: builds all DEB and RPM packages in Docker containers
    • build_repos.sh: builds the apt and yum repos including these packages
  • Since we are building in clean Docker containers under the appropriate OS, we no longer need an additional chroot for each build, so we simplify the scripts to call debuild and rpmbuild directly rather than via pbuilder and mock
  • All build results are output to build/ and this directory is added to .gitignore
  • HOWTO_PACKAGE.md is updated with the new procedures to follow
  • Some files related to RPM signing are removed since this will be handled internally
  • Fedora 39 is added to distro-info.sh since it has begun development

In our production builds (internally), we will first run build_packages.sh, then sign the packages, then run build_repos.sh and tar up all the build artifacts.

Tested by running:

$ ./build_packages.sh
$ ./build_repos.sh

Copy link
Member

@jewelpit jewelpit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than the git clean part :)


set -euxo pipefail

git clean -fdx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we either remove this or make it an interactive clean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also in favor of removing it. I suspect it was included in the original build_packages.py since this had to be run locally, but since we are moving to CI, where the checkout will always be clean, there is no value for release builds, and it's fairly anti-social if you're just testing locally.

@@ -17,3 +18,5 @@ for DIST in $DISTS; do

createrepo $DIST
done

cd ../..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not strictly necessary as this is run inside Docker. I added it so that if you run the script locally on your machine (outside Docker), it leaves you in the same directory that you started (the top-level repo root). I'll add a comment, but am happy to remove it if it causes some other problem


4. Copy `rpm_resources/.rpmmacros` to `~/.rpmmacros`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so glad to see the .rpmmacros stuff gone!

@palpant-dbx palpant-dbx merged commit f25922d into dropbox:master Mar 27, 2023
@palpant-dbx palpant-dbx deleted the build-docker branch March 27, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants