-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenerate_mapping.sh
More file actions
executable file
·32 lines (29 loc) · 1.76 KB
/
generate_mapping.sh
File metadata and controls
executable file
·32 lines (29 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Truncate the quarkiverse-mapping.properties file
truncate -s 0 quarkiverse-mapping.properties
# Iterate through all Quarkiverse repositories and generate a mapping file
gh repo list quarkiverse --jq '.[].nameWithOwner' --topic quarkus-extension --json nameWithOwner --no-archived -L 1000 | sort | while read repo; do
# Get the groupId from the pom.xml file
groupId=$(gh api -H "Accept: application/vnd.github.raw" /repos/$repo/contents/pom.xml 2>/dev/null | xmllint --xpath "//*[local-name()='project']/*[local-name()='groupId']/text()" - 2>/dev/null)
# If the groupId is not empty, print the repository name
if [ -n "$groupId" ]; then
# Print the repository name and the groupId
echo -e "$repo=$groupId"
# Append the repository name and the groupId to the quarkiverse-mapping.properties file
echo -e "$repo=$groupId" >> quarkiverse-mapping.properties
fi
done
# Truncate the quarkiverse-app-mapping.properties file
truncate -s 0 quarkiverse-app-mapping.properties
# Iterate through all Quarkiverse app repositories and generate a mapping file
gh repo list quarkiverse --jq '.[].nameWithOwner' --topic quarkus-app --json nameWithOwner --no-archived -L 1000 | sort | while read repo; do
# Get the groupId from the pom.xml file
groupId=$(gh api -H "Accept: application/vnd.github.raw" /repos/$repo/contents/pom.xml 2>/dev/null | xmllint --xpath "//*[local-name()='project']/*[local-name()='groupId']/text()" - 2>/dev/null)
# If the groupId is not empty, print the repository name
if [ -n "$groupId" ]; then
# Print the repository name and the groupId
echo -e "$repo=$groupId"
# Append the repository name and the groupId to the quarkiverse-mapping.properties file
echo -e "$repo=$groupId" >> quarkiverse-app-mapping.properties
fi
done