X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=tools%2Fgen-repo.sh;h=b7bb2f5e435d156e95b698191c010fa23b04debe;hb=0bff497a70fbf700d31e79ed2e212bb4d1b4639b;hp=5227f880e61f15a44b824817e6aca4224b1f3593;hpb=cb6f74f800556fd2e2f88a35f0118b687ad599fc;p=osm%2Fdevops.git diff --git a/tools/gen-repo.sh b/tools/gen-repo.sh index 5227f880..b7bb2f5e 100755 --- a/tools/gen-repo.sh +++ b/tools/gen-repo.sh @@ -13,6 +13,7 @@ function usage() { echo -e " -r " echo -e " -h " echo -e " -R " + echo -e " -P " exit 1 } @@ -31,6 +32,7 @@ function dump_vars() { echo "BUILD: $BUILD" echo "RSYNC_USER_HOST $RSYNC_USER_HOST" echo "RSYNC_OPTIONS $RSYNC_OPTIONS" + echo "PUBLIC_KEY_FILE $PUBLIC_KEY_FILE" } IN_REPO="unstable" @@ -41,8 +43,9 @@ REPO_BASE=repo RELEASE_DIR=ReleaseTWO RSYNC_USER_HOST=osmusers@osm-download.etsi.org CURR_DIR=$(pwd) +PUBLIC_KEY_FILE=~/OSM\ ETSI\ Release\ Key.gpg -while getopts ":p:i:o:k:j::d:b:r:h:R:" o; do +while getopts ":p:i:o:k:j::d:b:r:h:R:P:" o; do case "${o}" in p) PASSPHRASE_FILE=${OPTARG} @@ -74,6 +77,9 @@ while getopts ":p:i:o:k:j::d:b:r:h:R:" o; do R) RSYNC_OPTIONS=${OPTARG} ;; + P) + PUBLIC_KEY_FILE=${OPTARG} + ;; *) usage exit 1 @@ -93,7 +99,7 @@ $JFROG_CLI rt download --build "$BUILD" osm-release || FATAL "Failed to download BUILD_NUMBER=$(basename "$BUILD") -[ $PASSPHRASE_FILE ] && GPG_PASSPHRASE="--no-use-agent --passphrase \"$(cat $PASSPHRASE_FILE)\"" +[ $PASSPHRASE_FILE ] && GPG_PASSPHRASE="--no-tty --no-use-agent --passphrase \"$(cat $PASSPHRASE_FILE)\"" mkdir -p $BASE_DIR/dists @@ -119,13 +125,15 @@ apt-ftparchive release dists/$OUT_REPO > dists/$OUT_REPO/Release #gzip -9fk dists/$OUT_REPO/Release rm -f dists/$OUT_REPO/InRelease -eval gpg $GPG_PASSPHRASE --default-key $GPGKEY --clearsign -o dists/$OUT_REPO/InRelease dists/$OUT_REPO/Release +eval gpg $GPG_PASSPHRASE --no-tty --default-key $GPGKEY --clearsign -o dists/$OUT_REPO/InRelease dists/$OUT_REPO/Release rm -f dists/$OUT_REPO/Release.gpg -eval gpg $GPG_PASSPHRASE --default-key $GPGKEY -abs -o dists/$OUT_REPO/Release.gpg dists/$OUT_REPO/Release - +eval gpg $GPG_PASSPHRASE --no-tty --default-key $GPGKEY -abs -o dists/$OUT_REPO/Release.gpg dists/$OUT_REPO/Release echo "performing rsync of repo $RELEASE_DIR/dist/$OUT_REPO to osm-download.etsi.org:/repos/" cd $CURR_DIR/$REPO_BASE +# copy over the public key file +[ "$PUBLIC_KEY_FILE" ] && cp "$PUBLIC_KEY_FILE" osm/debian/$RELEASE_DIR + rsync -avR $RSYNC_OPTIONS osm/debian/$RELEASE_DIR rsync://$RSYNC_USER_HOST/repos