From: amin m Date: Wed, 7 Aug 2019 13:16:16 +0000 (+0200) Subject: Upload changed RPMs/SRPMs to Nexus X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=0acd1ca3066cc1a56199cd25174ae6972a75411b;p=ci-management.git Upload changed RPMs/SRPMs to Nexus Change-Id: Id71de6e22b51b843a2f05f4113f0657496cb7c06 Signed-off-by: amin m --- diff --git a/jjb/shell/ta-rpm-deploy.sh b/jjb/shell/ta-rpm-deploy.sh index 36c7c5b..eeb1af6 100644 --- a/jjb/shell/ta-rpm-deploy.sh +++ b/jjb/shell/ta-rpm-deploy.sh @@ -23,12 +23,38 @@ repo_dir="$WORKSPACE/work/nexus/$NEXUS_REPO" x86_dir="$repo_dir/$release_path/rpms/x86_64" sources_dir="$repo_dir/$release_path/rpms/Sources" nexus_repo_url="$ALT_NEXUS_URL/repository/$NEXUS_REPO" +results_dir="$WORKSPACE/work/results" +repo_name=`echo $WORKSPACE | awk -F '/' '{print $4}' | cut -d '-' -f2- | sed 's|\(.*\)-.*|\1|'` + +#Creating dir to move duplicate RPMs/SRPMs to avoid re-upload +mkdir "$results_dir/repo/duplicates" +mkdir "$results_dir/src_repo/duplicates" + +#List all RPMs available in Nexus and move the duplicates +for artifact in \ + `ls $results_dir/repo` + do + if curl --head --fail $nexus_repo_url/$release_path/rpms/x86_64/$artifact + then + mv $results_dir/repo/$artifact $results_dir/repo/duplicates/ + fi + done + +#List all SRPMs available in Nexus and move the duplicates +for artifact in \ + `ls $results_dir/src_repo` + do + if curl --head --fail $nexus_repo_url/$release_path/rpms/Sources/$artifact + then + mv $results_dir/src_repo/$artifact $results_dir/src_repo/duplicates/ + fi + done mkdir -p "$x86_dir" mkdir -p "$sources_dir" -cp "$WORKSPACE/work/results/repo/"*.rpm "$x86_dir" -cp "$WORKSPACE/work/results/src_repo/"*.rpm "$sources_dir" +cp "$results_dir/repo/"*.rpm "$x86_dir" +cp "$results_dir/src_repo/"*.rpm "$sources_dir" echo "-----> Upload RPMs to Nexus" lftools deploy nexus "$nexus_repo_url" "$repo_dir"