aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts/check-java-manifest.sh
blob: 3c6db49a60f629e9acff18fe24fb1af5af43de8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

if [ "$#" -ne 1 ]; then
    echo This script checks java-manifest.csv to verify that the specified versions have been released in nexus
    echo "$0 <java-manifest.csv>"
    exit 1
fi

if [ -z "$WORKSPACE" ]; then
    export WORKSPACE=`git rev-parse --show-toplevel`
fi

NEXUS_RELEASE_PREFIX="https://nexus.onap.org/content/repositories/releases"

err=0
for line in $(tail -n +2 $1); do
    group=$(echo $line | cut -d , -f 1)
    artifact=$(echo $line | cut -d , -f 2)
    version=$(echo $line | cut -d , -f 3)
    path=$(echo $group/$artifact | tr '.' '/')

    url="$NEXUS_RELEASE_PREFIX/$path/$version/"
    http_code=$(curl -s -o /dev/null -I -w "%{http_code}" $url)
    if [ $http_code -ne 200 ]; then
        echo "[WARNING] $group:$artifact:$version not released"
        (( err++ ))
    else
        echo "[INFO] $group:$artifact:$version OK"
    fi
done
#exit $err
exit 0