Using the traditional createrepo to create RPM repositories can be hard if you work with containers and S3 storage. Most solutions involve downloading the entire repository to update the metadata. This can be costly when dealing with large repositories.
createrepo-s3
is trying to solve this problem by allowing to add new files to
a repository living in S3 while keeping all old metadata and packages as they
are.
The script is basically a wrapper around s3cmd
and createrepo
.
The tool needs to be run on a directory which only contains the RPMs you want to add. It will then:
- Use
s3cmd
to list all RPM files in S3 - Touch all these files locally, creating an empty file for each RPM
- Launch
createrepo
, instructing it to only check for file existence - Remove the empty files
- Upload everything else to S3
-
createrepo
installed -
s3cmd
installed and configured- Make sure
s3cmd ls s3://
(no arguments) works
- Make sure
-
The S3 location must already contain a valid RPM repository. You can use
createrepo
for initialization:mkdir repository createrepo repository s3cmd put -r repository s3://my_bucket/
Add xy-0.6.1-1.fc36.x86_64.rpm
to the repository:
mkdir repository
cp /path/tp/xy-0.6.1-1.fc36.x86_64.rpm repository/
createrepo-s3 /tmp/repofolder/ jasöldkmvi keyaölskjmdf s3.mys3.de s3://myrepobuckets/production
- Bucket names and paths may not contain
#
- This does not deal with concurrency. Simultaneous updates may overwrite each other.
- This only allows for adding new packages. Updating existing ones does not work. You should release a new version anyway ;-)
$1 = LOCAL FOLDER "/tmp/repofolder" $2 = S3 BUCKETURL "s3.mys3.de" $3 = S3 ACCESS_KEY "jasöldkmvi" $4 = S3 SECRET_KEY "keyaölskjmdf" $5 = S3 BUCKETPATH "myrepobuckets/production"