I have used make deb-pkg
to generate the following files:
linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1.debian.tar.gz
linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1.dsc
linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1_armhf.changes
linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+.orig.tar.gz
linux-headers-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1_armhf.deb
linux-image-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1_armhf.deb
linux-libc-dev_4.14.20-rt17-v7+-1_armhf.deb
Now I would like to somehow upload these to my launchpad repository using a bash script. There doesn't seem to be documentation on how to upload packages that are already built though.
Following these instructions from launchpad, this is what I came up with:
# Get the source package files
wget https://gitlab.com/T-vK/rpi-rt-kernel-build-project/-/jobs/54062792/artifacts/raw/linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1_armhf.changes
wget https://gitlab.com/T-vK/rpi-rt-kernel-build-project/-/jobs/54062792/artifacts/raw/linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1.debian.tar.gz
wget https://gitlab.com/T-vK/rpi-rt-kernel-build-project/-/jobs/54062792/artifacts/raw/linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1.dsc
#-wget https://gitlab.com/T-vK/rpi-rt-kernel-build-project/-/jobs/54062792/artifacts/raw/linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+.orig.tar.gz
# Register ssh key from secret variable so that dput won't ask for a password when uploading
apt-get -qq install --yes dput openssh-client
eval $(ssh-agent -s)
echo "$LAUNCHPAD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Prepare sftp config for launchpad
echo '[rpi-rt-kernel]' > ~/.dput.cf
echo 'fqdn = ppa.launchpad.net' >> ~/.dput.cf
echo 'method = sftp' >> ~/.dput.cf
echo 'incoming = ~t-vk/ubuntu/rpi-rt-kernel/' >> ~/.dput.cf
echo 'incoming = ~t-vk/ubuntu/rpi-rt-kernel/debian' >> ~/.dput.cf # TODO: find out what the hell they mean by "<an ubuntu suite>" in the docs
echo 'login = t-vk' >> ~/.dput.cf
echo 'allow_unsigned_uploads = 0' >> ~/.dput.cf
# Upload to launchpad
export CHANGES_FILE=$(set -- *.changes; echo "$1") # first file ending with .changes
export DEBIAN_TAR_GZ_FILE=$(set -- *.debian.tar.gz; echo "$1") # first file ending with .debian.tar.gz
export DSC_FILE=$(set -- *.dsc; echo "$1") # first file ending with .dsc
#- export ORIG_TAR_GZ_FILE=$(set -- *.orig.tar.gz; echo "$1") # first file ending with .orig.tar.gz
dput rpi-rt-kernel $CHANGES_FILE
dput rpi-rt-kernel $DEBIAN_TAR_GZ_FILE
dput rpi-rt-kernel $DSC_FILE
#dput rpi-rt-kernel $ORIG_TAR_GZ_FILE
But it fails at dput rpi-rt-kernel $SOURCE_FILE
:
gpg: /builds/T-vK/rpi-rt-kernel-build-project/linux-4.14.20-rt17-v7+_4.14.20-rt17-v7+-1_armhf.changes: error 58: Invocation of gpgme_op_verify
$USER not set, will use login information.
Checking signature on .changes
Invocation of gpgme_op_verify: GPGME: No data
ERROR: Job failed: exit code 1
My gpg and ssh key are already added to my launchpad account.
Works for me when I use ftp and set
allow_unsigned_uploads = 1
.The easy way: FTP in Ubuntu 9.10 and newer
First, you need to tell
dput
where to send your package and by what method. To do that, edit~/.dput.cf
to look like this:Then run something like this: