Skip to content

Instantly share code, notes, and snippets.

@maxkarelov
Last active February 10, 2016 16:33
Show Gist options
  • Save maxkarelov/2864dbd4d934bcabe126 to your computer and use it in GitHub Desktop.
Save maxkarelov/2864dbd4d934bcabe126 to your computer and use it in GitHub Desktop.

Revisions

  1. maxkarelov revised this gist Feb 10, 2016. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions getlink.sh
    Original file line number Diff line number Diff line change
    @@ -11,13 +11,14 @@ if [[ $# != 4 ]]; then
    echo "Usage: $0 [GROUP_ID] [ARTIFACT_ID] [VERSION] [PACKAGING]"
    exit 1
    fi


    #curl --silent http://blabla/nexus/content/repositories/builds-all/ | sed -n 's/.*href="\([^"]*\).*/\1/p'
    curl -f --silent -LO ${NEXUS_URL}/service/local/repositories/central/content/`echo "$GROUP" | tr '.' '/'`/${ARTIFACT}/${VERSION}/${ARTIFACT}-${VERSION}.${PACKAGING}

    if [[ $? == 0 ]]; then
    echo "OK"
    exit 0
    fi

    echo "NOT FOUND"
    exit 1
  2. maxkarelov created this gist Feb 9, 2016.
    23 changes: 23 additions & 0 deletions getlink.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/bash

    NEXUS_URL=http://blabla:8080/nexus

    GROUP=$1
    ARTIFACT=$2
    VERSION=$3
    PACKAGING=$4

    if [[ $# != 4 ]]; then
    echo "Usage: $0 [GROUP_ID] [ARTIFACT_ID] [VERSION] [PACKAGING]"
    exit 1
    fi

    curl -f --silent -LO ${NEXUS_URL}/service/local/repositories/central/content/`echo "$GROUP" | tr '.' '/'`/${ARTIFACT}/${VERSION}/${ARTIFACT}-${VERSION}.${PACKAGING}

    if [[ $? == 0 ]]; then
    echo "OK"
    exit 0
    fi

    echo "NOT FOUND"
    exit 1