forked from eclipse-che/che-plugin-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to check plugins during the CI build (eclipse-che#13)
- Loading branch information
1 parent
5cb4578
commit 3c728c8
Showing
2 changed files
with
43 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
language: generic | ||
language: bash | ||
|
||
install: | ||
- pip install --user yq | ||
|
||
script: | ||
- bash check_plugins_location.sh |
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,36 @@ | ||
#!/bin/bash | ||
|
||
## browse all plugin directories which names goes as follow | ||
## <plugin id>/<plugin version> | ||
## and check that directory names match with id/version in meta.yaml files | ||
cd plugins | ||
for d in */ ; do | ||
ID_DIR_NAME=${d%/} | ||
cd $d | ||
|
||
VERSION_DIR_NAME=$(ls -d */) | ||
VERSION_DIR_NAME=${VERSION_DIR_NAME%/} | ||
cd $VERSION_DIR_NAME | ||
|
||
ID_YAML=$(yq .id meta.yaml | sed 's/^"\(.*\)"$/\1/') | ||
if [[ "$ID_YAML" != "$ID_DIR_NAME" ]];then | ||
echo "!!! ID mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':" | ||
echo "!!! id in meta.yaml: '${ID_YAML}'" | ||
echo "!!! id directory name: '${ID_DIR_NAME}' " | ||
FOUND=true | ||
fi | ||
|
||
VERSION_YAML=$(yq .version meta.yaml | sed 's/^"\(.*\)"$/\1/') | ||
if [[ "$VERSION_YAML" != "$VERSION_DIR_NAME" ]];then | ||
echo "!!! Version mismatch in plugin '${ID_DIR_NAME}/${VERSION_DIR_NAME}':" | ||
echo "!!! version in meta.yaml: '${VERSION_YAML}'" | ||
echo "!!! version directory name: '${VERSION_DIR_NAME}' " | ||
FOUND=true | ||
fi | ||
|
||
cd ../.. | ||
done | ||
|
||
if [[ $FOUND ]];then | ||
exit 1 | ||
fi |