diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2018-10-12 13:13:13 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2018-10-12 13:13:13 -0700 |
commit | 96692b3dadd390350fe8d4246d0fe8c897c6cd24 (patch) | |
tree | 7d591728423e37be6bc4d1107268db0e82851c67 | |
parent | c1146f195fc05d7b7e95b6e8abe303ef7e544edc (diff) |
Check that java artifacts in manifest are released
Change-Id: If9be2267c9b9fd7255bc1f809513c1c5b7092fba
Issue-ID: INT-586
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
-rw-r--r-- | version-manifest/pom.xml | 13 | ||||
-rwxr-xr-x | version-manifest/src/main/scripts/check-java-manifest.sh | 32 |
2 files changed, 45 insertions, 0 deletions
diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml index 4202b2655..27fb4f478 100644 --- a/version-manifest/pom.xml +++ b/version-manifest/pom.xml @@ -149,6 +149,19 @@ </arguments> </configuration> </execution> + <execution> + <id>check-java-artifacts-released</id> + <phase>verify</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <arguments> + <argument>${project.basedir}/src/main/scripts/check-java-manifest.sh</argument> + <argument>${project.basedir}/src/main/resources/java-manifest.csv</argument> + </arguments> + </configuration> + </execution> </executions> </plugin> </plugins> diff --git a/version-manifest/src/main/scripts/check-java-manifest.sh b/version-manifest/src/main/scripts/check-java-manifest.sh new file mode 100755 index 000000000..3c6db49a6 --- /dev/null +++ b/version-manifest/src/main/scripts/check-java-manifest.sh @@ -0,0 +1,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 |