Skip to content

Instantly share code, notes, and snippets.

@alfredodeza
Created April 7, 2015 16:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredodeza/b8f8b94ea795f1a7169b to your computer and use it in GitHub Desktop.
Save alfredodeza/b8f8b94ea795f1a7169b to your computer and use it in GitHub Desktop.
new Ceph release repo
# create the new rpm directory
mkdir rpm-hammer
cd rpm-hammer
# make the directories for the distros we need for x86_64
mkdir -p el6/x86_64/
mkdir -p el7/x86_64/
mkdir -p fc20/x86_64/
mkdir -p rhel6/x86_64/
mkdir -p rhel7/x86_64/
# make the directories for the distros we need for noarch
mkdir -p el6/noarch/
mkdir -p el7/noarch/
mkdir -p fc20/noarch/
mkdir -p rhel6/noarch/
mkdir -p rhel7/noarch/
# some packages may be needed for some distros that are not built
# when Ceph is (e.g. xfsprogs)
# cd to the previous release (e.g. rpm-giant) and then copy these packages over
# xfsprogs
for i in *; do cp -avf $i/x86_64/*xfs* ../rpm-hammer/$i/x86_64/; done
# snappy and snappy-devel
for i in *; do cp -avf $i/x86_64/*snapp* ../rpm-hammer/$i/x86_64/; done
# leveldb and leveldb-dev
for i in *; do cp -avf $i/x86_64/*leveld* ../rpm-hammer/$i/x86_64/; done
# gperftools
for i in *; do cp -avf $i/x86_64/*gperf* ../rpm-hammer/$i/x86_64/; done
# gdisk
for i in *; do cp -avf $i/x86_64/*gdisk* ../rpm-hammer/$i/x86_64/; done
# fcgi
for i in *; do cp -avf $i/x86_64/*fcgi* ../rpm-hammer/$i/x86_64/; done
# now copy the `noarch` packages
for i in *; do cp -avf $i/noarch/*.rpm ../rpm-hammer/$i/noarch/; done
# DEBIAN stuff.
# create the directory for debian packages
mkdir /home/ubuntu/repos/debian-hammer
# create the conf directory
cd /home/ubuntu/repos/debian-hammer
mkdir conf
# create a distributions file
touch distributions
# now fill it with the distributions supported, just like the previous version did
# unless a distribution is being dropped. This is how one entry would look like:
# Codename: wheezy
# Suite: stable
# Components: main
# Architectures: amd64 armhf i386 source
# Origin: Inktank
# Description: Ceph distributed file system
# DebIndices: Packages Release . .gz .bz2
# DscIndices: Sources Release .gz .bz2
# Contents: .gz .bz2
# SignWith: 17ED316D
# edit the add_curl_to_deb_repo.sh that doesn't add deb's only, it adds to rpms as well (!)
# so that it has the new repo we are creating (contents pasted here):
#! /bin/bash
JOB=curl
BUILD=7
ARTIFACT=dist
COMPONENT=main
#KEYID=${KEYID:-03C3951A} # default is autobuild keyid
KEYID=${KEYID:-17ED316D} # default is release keyid
#CODENAME=testing
#CODENAME=cuttlefish
#CODENAME=dumpling
#CODENAME=emperor
#CODENAME=firefly
#CODENAME=giant
CODENAME=hammer
#SRC=/var/lib/jenkins/jobs/${JOB}/configurations/axis-label
SRC=/home2/jenkins/jobs/${JOB}/configurations/axis-label
RPM_REPO=/home/ubuntu/repos/rpm-${CODENAME}
DEB_REPO=/home/ubuntu/repos/debian-${CODENAME}
DISTS="precise quantal raring squeeze wheezy"
SOURCE_ADDED="NO"
if [ ! -d $SRC ] ; then
echo "Source directory not found: $SRC"
exit 1
fi
if [ ! -d $DEB_REPO ] ; then
echo "Repo directory not found: $DEB_REPO"
exit 1
fi
if gpg --list-keys 2>/dev/null | grep -q ${KEYID} ; then
echo "Signing packages and repo with ${KEYID}"
else
echo "Package signing key (${KEYID}) not found"
echo "Have you set \$GNUPGHOME ? "
exit 3
fi
for dist in ${DISTS}
do
echo $dist
dir=${SRC}/gitbuilder-cdep-deb-${dist}-amd64-basic/builds/${BUILD}/archive/${ARTIFACT}
if [ ! -d $dir ] ; then
echo "missing $dir"
continue
fi
(
echo $dir
cd $dir
reprepro --ask-passphrase -b $DEB_REPO -C $COMPONENT --type deb --ignore=undefinedtarget --ignore=wrongdistribution include $dist *.changes
reprepro --ask-passphrase -b $DEB_REPO -C $COMPONENT --type dsc --ignore=undefinedtarget --ignore=wrongdistribution include $dist *.changes
)
done
##############################################
# Add libleveldb by going into the previous builds dir for it
cd /home2/jenkins/jobs/leveldb/configurations/axis-label/
# and now copy it for the distros that need it
for dist in raring quantal squeeze wheezy precise; do cd /home2/jenkins/jobs/leveldb/configurations/axis-label/*$dist*/builds/10/archive/dist/; reprepro --ask-passphrase -b ~/repos/debian-hammer/ -C main --type dsc --ignore=undefinedtarget --ignore=wrongdistribution --ignore=missingfile include $dist *.changes; done
# output should look like:
# Unable to find pool/main/l/leveldb/leveldb_1.12.0.orig.tar.gz!
# Perhaps you forgot to give dpkg-buildpackage the -sa option.
# --ignore=missingfile was given, searching for file...
# Exporting indices...
# Exporting indices...
# Exporting indices...
# Exporting indices...
# Exporting indices...
# next up is snappy that also needs to be copied
# again, use the previous release as a reference, in this case `giant`
cd repos/debian-giant/pool/main/s/snappy/
# for the radosgw-agent
cd repos/debian-giant/pool/main/r/radosgw-agent/
# seems like we need to check for 'wheezy' vs 'squeeze' otherwise packages will have a different
# "bpo" ending.
for i in raring quantal squeeze wheezy precise trusty; do dist=$i; if [ "$i" == "wheezy" ]; then i=bpo7; fi; if [ "$i" == "squeeze" ]; then i=bpo6; fi; for file in *$i*.deb; do reprepro --ask-passphrase -b ~/repos/debian-hammer/ -C main includedeb $dist "$file"; done; done
# repeat for requests
# note that we now check for 'cloud' too
cd ../requests
for i in raring quantal squeeze wheezy precise trusty; do dist=$i; if [ "$i" == "wheezy" ]; then i=bpo7; fi; if [ "$i" == "squeeze" ]; then i=bpo6; fi; if [ "$i" == "precise" ]; then i=cloud; fi; for file in *$i*.deb; do reprepro --ask-passphrase -b ~/repos/debian-hammer/ -C main includedeb $dist "$file"; done; done
# in the original history there were entries for `python-pushy` but that is
# legacy, it was used by ceph-deploy but not anymore so skip that
# now copy urllib3, note the 'cloud' termination as well
for i in raring quantal squeeze wheezy precise trusty; do dist=$i; if [ "$i" == "wheezy" ]; then i=bpo7; fi; if [ "$i" == "squeeze" ]; then i=bpo6; fi; if [ "$i" == "precise" ]; then i=cloud; fi; for file in *$i*.deb; do reprepro --ask-passphrase -b ~/repos/debian-hammer/ -C main includedeb $dist "$file"; done; done
# repeat for gperftools
# there is no 'cloud' here so back to the normal deb check
for i in raring quantal squeeze wheezy precise trusty; do dist=$i; if [ "$i" == "wheezy" ]; then i=bpo7; fi; if [ "$i" == "squeeze" ]; then i=bpo6; fi; for file in *$i*.deb; do reprepro --ask-passphrase -b ~/repos/debian-hammer/ -C main includedeb $dist "$file"; done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment