Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#18 : Overriding ability to change the mvn repository url to download jar from #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ Veracode recommends that you use the toplevel parameter if you want to ensure th

**Optional** BOOLEAN - Set to true to show detailed diagnostic information, which you can use for debugging, in the output.

## Environment variables

### Optional envvars

### `MVN_REPO_URL`

**Optional** STRING - Set to use an alternative maven repository.

If `MVN_REPO_URL` is set then the jar wrapper is downloaded from this url. Otherwise, the default central will be used (`https://repo1.maven.apache.org/maven2`).

## Examples

### General Usage
Expand All @@ -137,6 +147,8 @@ jobs:

- name: Veracode Upload And Scan
uses: veracode/[email protected]
# env:
# MVN_REPO_URL: "https://my.company.com/repository/central"
with:
appname: 'VeraDemo'
createprofile: false
Expand Down
12 changes: 8 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,16 @@ fi

echo " -createprofile \"$createprofile\" \\" >> runJava.sh

if [ ! -n "$MVN_REPO_URL" ]; then
MVN_REPO_URL="https://repo1.maven.apache.org/maven2"
fi

if [ "$javawrapperversion" ]
then
then
javawrapperversion=$javawrapperversion
else #fetch latest wrapper version from Maven
javawrapperversion=$(curl https://repo1.maven.org/maven2/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/maven-metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1)
fi
javawrapperversion=$(curl $MVN_REPO_URL/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/maven-metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1)
fi

echo "javawrapperversion: $javawrapperversion"

Expand All @@ -248,7 +252,7 @@ then
echo " -debug \"$debug\"" >> runJava.sh
fi

curl -sS -o VeracodeJavaAPI.jar "https://repo1.maven.org/maven2/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/$javawrapperversion/vosp-api-wrappers-java-$javawrapperversion.jar"
curl -sS -o VeracodeJavaAPI.jar "$MVN_REPO_URL/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/$javawrapperversion/vosp-api-wrappers-java-$javawrapperversion.jar"
chmod 777 runJava.sh
cat runJava.sh
./runJava.sh