-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b80713
commit 8419d8d
Showing
4 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Module Descriptor Batch Validator | ||
This script helps to validate module descriptors for modules gathered in `install.json`. | ||
|
||
### Usage | ||
Place the `md-validator.sh` file next to `install.json` and run the command: | ||
```bash | ||
./md-validator.sh | ||
``` | ||
|
||
### How it works | ||
The script parses the `install.json` file, retrieves all module IDs, and downloads the module descriptors sequentially. Then, the plugin validates the module descriptors. It is based on the non-project usage feature of the plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
JSON_FILE="install.json" | ||
BASE_URL="https://folio-registry.dev.folio.org/_/proxy/modules" | ||
PLUGIN_GROUP_ID="org.folio" | ||
PLUGIN_ARTIFACT_ID="folio-module-descriptor-validator" | ||
PLUGIN_VERSION="0.0.1-SNAPSHOT" | ||
PLUGIN_GOAL="validate" | ||
|
||
ids=$(jq -r '.[].id' $JSON_FILE) | ||
|
||
for id in $ids; do | ||
FILE_URL="$BASE_URL/$id" | ||
FILE_PATH="$id.json" | ||
|
||
curl -sS -o $FILE_PATH $FILE_URL | ||
|
||
echo -n "Validation $FILE_PATH started... " | ||
|
||
if [ $? -eq 0 ]; then | ||
|
||
mvn $PLUGIN_GROUP_ID:$PLUGIN_ARTIFACT_ID:$PLUGIN_VERSION:$PLUGIN_GOAL -q -DmoduleDescriptorFile=$FILE_PATH | ||
|
||
rm -f $FILE_PATH | ||
echo -ne "\rValidation $FILE_PATH DONE " | ||
echo "" | ||
else | ||
echo "Failed to download $FILE_URL" | ||
fi | ||
done | ||
|
||
rm -f $TEMP_POM | ||
|
||
echo "All operations completed." |