From 5d4bad743bbfc0ff3db6e9cb79e963a4b48c0cee Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 28 Jun 2017 18:35:53 -0400 Subject: [PATCH 1/1] Remove signing scripts from releng/builder These scripts are migrated into lftools. https://gerrit.linuxfoundation.org/infra/5343 Change-Id: Iba04fd8579867fd9215a0e5aff3067c7d9ab7052 Signed-off-by: Thanh Ha --- scripts/odlrelease | 86 -------------------------------------------- scripts/odlsign-bulk | 72 ------------------------------------- 2 files changed, 158 deletions(-) delete mode 100755 scripts/odlrelease delete mode 100755 scripts/odlsign-bulk diff --git a/scripts/odlrelease b/scripts/odlrelease deleted file mode 100755 index 61526084e..000000000 --- a/scripts/odlrelease +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# @License EPL-1.0 -############################################################################## -# Copyright (c) 2015 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## - -ARTIFACT_DIR=".sign-artifacts" -SIGNATURES_DIR="gpg-signatures" - - -function print_usage { - echo "Usage: $0 sign " - echo "" - echo " sign : Downloads and Signs artifacts from Nexus" -} - - -# Downloads artifacts from a Nexus URL and creates gpg signatures for them -# and copies the signatures to a separate directory. -function sign { - echo "Signing artifacts..." - - if [ -d "$ARTIFACT_DIR" ]; then - echo "$ARTIFACT_DIR directory exists. Clearing..." - rm -rf $ARTIFACT_DIR - fi - - mkdir $ARTIFACT_DIR - cd $ARTIFACT_DIR - - echo "Fetching artifacts from $URL" - # Fetch Artifacts - wget --recursive --execute robots=off --no-parent --quiet \ - --no-host-directories --cut-dirs=3 \ - $URL - - # Remove files that don't need signing - find . -type f \ - -name "*.asc" \ - -o -name "*.sha1" \ - -o -name "*.md5" \ - -o -name "_maven.repositories*" \ - -o -name "_remote.repositories*" \ - -o -name "maven-metadata-local.xml*" \ - -o -name "maven-metadata.xml*" \ - -o -name "index.html*" | xargs rm - - for f in `find . -type f ! -name "*.asc" ! -name "*.sha1" ! -name "*.md5"` - do - echo "Signing $f" - gpg --batch -abq $f - done - - cd .. - - if [ -d "$SIGNATURES_DIR" ]; then - echo "$SIGNATURES_DIR directory exists. Clearing..." - rm -rf $SIGNATURES_DIR - fi - - rsync -avz --include '*/' --include '*.asc' --exclude '*' \ - "${ARTIFACT_DIR}/org" "${SIGNATURES_DIR}" -} - - -if [ -z "$2" ]; then - print_usage - exit 1 -fi - -MODE=$1 -URL=$2 - -if [ "$MODE" == "sign" ]; then - sign -else - echo "ERROR: Invalid mode." - print_usage - exit 1 -fi diff --git a/scripts/odlsign-bulk b/scripts/odlsign-bulk deleted file mode 100755 index 36443f389..000000000 --- a/scripts/odlsign-bulk +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# @License EPL-1.0 -############################################################################## -# Copyright (c) 2016 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## - -# Force any errors to cause the script to end with failure -set -eu -o pipefail - -function print_usage { - echo "Usage: $0 " - echo "" - echo " : The Nexus staging repo ID to sign." -} - -if [ -z "$1" ]; then - print_usage - exit 1 -fi - -SIGNREPO=$1 -SIGNATURES_DIR="gpg-signatures" -TMPFILE=/tmp/project-list.txt - -wget -q https://nexus.opendaylight.org/content/repositories/$SIGNREPO/org/opendaylight/ -O $TMPFILE -PROJECTS=`grep '/' $TMPFILE | sed -e 's#/.*##' -e 's#.*/">##'` -echo "Projects detected: $PROJECTS" - -# -# Prepare staging repo to upload signatures to -# - -if [ -d "$SIGNATURES_DIR" ]; then - echo "$SIGNATURES_DIR directory exists. Clearing..." - rm -rf $SIGNATURES_DIR -fi -mkdir $SIGNATURES_DIR - -mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy-staged-repository \ - -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -DskipStagingRepositoryClose=true \ - -DrepositoryDirectory="$SIGNATURES_DIR" \ - -DnexusUrl=https://nexus.opendaylight.org/ \ - -DstagingProfileId="425e43800fea70" \ - -DserverId="opendaylight.staging" | tee /tmp/deploy-staged-repository.log - -STAGED_REPO_ID=`grep 'Created staging repository with ID' /tmp/deploy-staged-repository.log | sed -e 's/.*ID "//' -e 's/".*//'` -echo "Staged Repo: $STAGED_REPO_ID" - -# -# Finally retrieve and sign artifacts. -# - -for i in $PROJECTS -do - echo "Signing $i" - ./odlrelease sign http://nexus.opendaylight.org/content/repositories/$SIGNREPO/org/opendaylight/$i/ - mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy-staged-repository \ - -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -DskipStagingRepositoryClose=true \ - -DstagingRepositoryId=$STAGED_REPO_ID \ - -DrepositoryDirectory="$SIGNATURES_DIR" \ - -DnexusUrl=https://nexus.opendaylight.org/ \ - -DstagingProfileId="425e43800fea70" \ - -DserverId="opendaylight.staging" -done -- 2.36.6