github.com/skf/moby@v1.13.1/hack/make/release-rpm (about) 1 #!/bin/bash 2 set -e 3 4 # This script creates the yum repos for the .rpm files generated by hack/make/build-rpm 5 # 6 # The following can then be used as a yum repo: 7 # http://yum.dockerproject.org/repo/$release/$distro/$distro-version 8 # 9 # For example: 10 # http://yum.dockerproject.org/repo/main/fedora/23 11 # http://yum.dockerproject.org/repo/testing/centos/7 12 # http://yum.dockerproject.org/repo/experimental/fedora/23 13 # http://yum.dockerproject.org/repo/main/centos/7 14 # 15 # ... and so on and so forth for the builds created by hack/make/build-rpm 16 17 : ${DOCKER_RELEASE_DIR:=$DEST} 18 YUMDIR=$DOCKER_RELEASE_DIR/yum/repo 19 : ${GPG_KEYID:=releasedocker} 20 21 # get the release 22 release="main" 23 24 if [[ "$VERSION" == *-rc* ]]; then 25 release="testing" 26 fi 27 28 if [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then 29 release="experimental" 30 fi 31 32 # Setup the yum repo 33 for dir in bundles/$VERSION/build-rpm/*/; do 34 version="$(basename "$dir")" 35 suite="${version##*-}" 36 distro="${version%-*}" 37 38 REPO=$YUMDIR/$release/$distro 39 40 # if the directory does not exist, initialize the yum repo 41 if [[ ! -d $REPO/$suite/Packages ]]; then 42 mkdir -p "$REPO/$suite/Packages" 43 44 createrepo --pretty "$REPO/$suite" 45 fi 46 47 # path to rpms 48 RPMFILE=( "bundles/$VERSION/build-rpm/$version/RPMS/"*"/docker-engine"*.rpm "bundles/$VERSION/build-rpm/$version/SRPMS/docker-engine"*.rpm ) 49 50 # if we have a $GPG_PASSPHRASE we may as well 51 # sign the rpms before adding to repo 52 if [ ! -z $GPG_PASSPHRASE ]; then 53 # export our key to rpm import 54 gpg --armor --export "$GPG_KEYID" > /tmp/gpg 55 rpm --import /tmp/gpg 56 57 # sign the rpms 58 echo "yes" | setsid rpm \ 59 --define "_gpg_name $GPG_KEYID" \ 60 --define "_signature gpg" \ 61 --define "__gpg_check_password_cmd /bin/true" \ 62 --define "__gpg_sign_cmd %{__gpg} gpg --batch --no-armor --digest-algo 'sha512' --passphrase '$GPG_PASSPHRASE' --no-secmem-warning -u '%{_gpg_name}' --sign --detach-sign --output %{__signature_filename} %{__plaintext_filename}" \ 63 --resign "${RPMFILE[@]}" 64 fi 65 66 # copy the rpms to the packages folder 67 cp "${RPMFILE[@]}" "$REPO/$suite/Packages" 68 69 # update the repo 70 createrepo --pretty --update "$REPO/$suite" 71 done