@@ -5,7 +5,7 @@ export LC_ALL=C
55
66# script to generate rhdh-supported-plugins.adoc from content in
77# https://github.com/redhat-developer/rhdh/tree/main/catalog-entities/extensions/packages/
8- # and optionally generate ref-community-plugins-migration .adoc from
8+ # and optionally generate ref-community-plugins.adoc from
99# https://github.com/redhat-developer/rhdh-plugin-export-overlays
1010
1111SCRIPT_DIR=$( cd " $( dirname " $0 " ) " || exit ; pwd)
@@ -21,7 +21,7 @@ DO_CLEAN=0
2121
2222BRANCH=main
2323SKIP_TABLES=0
24- SKIP_MIGRATION =0
24+ SKIP_COMMUNITY_TABLE =0
2525
2626rhdhRepo=" https://github.com/redhat-developer/rhdh"
2727overlaysRepo=" https://github.com/redhat-developer/rhdh-plugin-export-overlays"
@@ -58,19 +58,19 @@ Usage:
5858$0 -b stable-ref-branch [options]
5959
6060Options:
61- -b, --ref-branch : Branch against which plugin versions should be incremented, like release-1.y; default: main
62- --skip-tables : Skip re-generating dynamic plugin tables and .csv
63- --skip-migration : Skip re-generating the migation guide
64- --clean : Force a clean GH checkout (do not reuse files on disk)
65- -v : more verbose output
66- -h, --help : Show this help
61+ -b, --ref-branch : Branch against which plugin versions should be incremented, like release-1.y; default: main
62+ --skip-tables : Skip re-generating dynamic plugin tables and .csv
63+ --skip-community-table : Skip re-generating the community plugins table
64+ --clean : Force a clean GH checkout (do not reuse files on disk)
65+ -v : more verbose output
66+ -h, --help : Show this help
6767
6868Examples:
6969
70- $0 -b release-1.9
71- $0 -b release-1.9 --clean
72- $0 -b release-1.9 --skip-migration # Only regen dynamic plugin tables
73- $0 -b main --skip-tables # Only regen migration guide
70+ $0 -b release-1.10
71+ $0 -b release-1.10 --clean
72+ $0 -b release-1.10 --skip-community-table # Only regen dynamic plugin tables
73+ $0 -b main --skip-tables # Only regen community table
7474
7575EOF
7676}
@@ -82,7 +82,7 @@ while [[ "$#" -gt 0 ]]; do
8282 ' --clean' ) DO_CLEAN=1;;
8383 ' -b' |' --ref-branch' ) BRANCH=" $2 " ; shift 1;; # reference branch, eg., 1.1.x
8484 ' --skip-tables' ) SKIP_TABLES=1;;
85- ' --skip-migration ' ) SKIP_MIGRATION =1;;
85+ ' --skip-community-table ' ) SKIP_COMMUNITY-table =1;;
8686 ' -v' ) QUIET=0;;
8787 ' -h' |' --help' ) usage; exit 0;;
8888 * ) echo " Unknown parameter used: $1 ." ; usage; exit 1;;
@@ -100,7 +100,7 @@ if [[ $DO_CLEAN -eq 1 ]]; then
100100 rm -fr /tmp/plugin-versions_" ${BRANCH} " .txt " ${rhdhtmpdir} " " ${overlaystmpdir} "
101101fi
102102
103- # fetch rhdh repo - not needed when regenerating migration table
103+ # fetch rhdh repo - not needed when regenerating community table
104104if [[ $SKIP_TABLES -eq 0 ]]; then
105105 if [[ ! -d " ${rhdhtmpdir} " ]]; then
106106 echo -e " ${green} Cloning $rhdhRepo (branch: $BRANCH )...${norm} "
@@ -110,7 +110,7 @@ if [[ $SKIP_TABLES -eq 0 ]]; then
110110 fi
111111fi
112112
113- # need this for BOTH the migration table generation AND the dynamic plugin tables generation
113+ # need this for BOTH the community table generation AND the dynamic plugin tables generation
114114if [[ ! -d " $overlaystmpdir " ]]; then
115115 echo -e " ${green} Cloning $overlaysRepo (branch: $BRANCH )...${norm} "
116116 pushd /tmp > /dev/null || exit
@@ -543,21 +543,21 @@ if [[ $SKIP_TABLES -eq 0 ]]; then
543543fi
544544
545545# ============================================================================
546- # Generate ref-community-plugins-migration .adoc from rhdh-plugin-export-overlays
546+ # Generate ref-community-plugins.adoc from rhdh-plugin-export-overlays
547547# ============================================================================
548- generate_migration_table () {
548+ generate_community_table () {
549549 if [[ ! -d " $overlaystmpdir " ]]; then
550550 echo -e " ${red} [ERROR] Overlays repo not found: $overlaystmpdir ${norm} "
551551 return 1
552552 fi
553553
554- echo -e " ${green} Generating community plugins migration table from $overlaystmpdir (branch: $BRANCH )${norm} "
554+ echo -e " ${green} Generating community plugins table from $overlaystmpdir (branch: $BRANCH )${norm} "
555555
556- MIGRATION_TABLE_FILE =" /tmp/migration_table_ ${BRANCH} .txt"
556+ COMMUNITY_TABLE_FILE =" /tmp/community_table_ ${BRANCH} .txt"
557557 BUNDLED_PLUGINS_FILE=" /tmp/bundled_plugins_${BRANCH} .txt"
558558
559- rm -f " $MIGRATION_TABLE_FILE " " $BUNDLED_PLUGINS_FILE "
560- touch " $MIGRATION_TABLE_FILE " " $BUNDLED_PLUGINS_FILE "
559+ rm -f " $COMMUNITY_TABLE_FILE " " $BUNDLED_PLUGINS_FILE "
560+ touch " $COMMUNITY_TABLE_FILE " " $BUNDLED_PLUGINS_FILE "
561561
562562 # Read the community packages list
563563 COMMUNITY_PACKAGES_FILE=" $overlaystmpdir /rhdh-community-packages.txt"
@@ -567,7 +567,7 @@ generate_migration_table() {
567567 return 1
568568 fi
569569
570- migration_count =0
570+ community_count =0
571571
572572 # Track processed plugins to avoid duplicates using a temp file
573573 PROCESSED_PLUGINS_FILE=" /tmp/processed_plugins_${BRANCH} .txt"
@@ -617,8 +617,6 @@ generate_migration_table() {
617617 fi
618618 echo " $plugin_name " >> " $PROCESSED_PLUGINS_FILE "
619619
620- # Construct old path from plugin name
621- old_path=" ./dynamic-plugins/dist/${plugin_name} "
622620
623621 # Extract new path - get the base URL without the version/integrity part
624622 # Format: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jenkins:bs_1.45.3__0.26.0
@@ -632,65 +630,53 @@ generate_migration_table() {
632630 display_title=" ${plugin_title:- $plugin_name } "
633631
634632 if [[ $QUIET -eq 0 ]]; then
635- echo " * Migration : $display_title "
633+ echo " * Plugin : $display_title "
636634 echo " Version: $plugin_version "
637- echo " Old: $old_path "
638- echo " New: $new_path "
635+ echo " Path: $new_path "
639636 fi
640637
641- # Add to migration table (sorted by title)
638+ # Add to community table (sorted by title)
642639 # shellcheck disable=SC2028
643- echo " ${display_title} ||*${display_title} *\n|${plugin_version} |\` ${old_path} \` \n| \` ${ new_path}\` " >> " $MIGRATION_TABLE_FILE "
640+ echo " ${display_title} ||*${display_title} *\n|${plugin_version} |\` ${new_path} \` " >> " $COMMUNITY_TABLE_FILE "
644641
645- migration_count =$(( migration_count + 1 ))
642+ community_count =$(( community_count + 1 ))
646643 done
647644 done < " $COMMUNITY_PACKAGES_FILE "
648645
649646 # Cleanup processed plugins tracking file
650647 rm -f " $PROCESSED_PLUGINS_FILE "
651648
652- # Add known bundled plugins - these are hardcoded as they require manual tracking
653- # These plugins continue to be bundled in 1.9 while transitioning to ghcr.io
654- # Format matches migration table: Plugin Name | Old Path | New Path
655- # shellcheck disable=SC2129
656- echo -e " |*Quay*\n|1.28.1|\` ./dynamic-plugins/dist/backstage-community-plugin-quay\` \n|\` oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-quay:<tag>\` \n" >> " $BUNDLED_PLUGINS_FILE "
657- echo -e " |*Scaffolder Backend Module Quay*\n|2.14.0|\` ./dynamic-plugins/dist/backstage-community-plugin-scaffolder-backend-module-quay-dynamic\` \n|\` oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:<tag>\` \n" >> " $BUNDLED_PLUGINS_FILE "
658- echo -e " |*Tekton*\n|3.33.3|\` ./dynamic-plugins/dist/backstage-community-plugin-tekton\` \n|\` oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-tekton:<tag>\` \n" >> " $BUNDLED_PLUGINS_FILE "
659- echo -e " |*Roadie ArgoCD Backend*\n|4.6.0|\` ./dynamic-plugins/dist/roadiehq-backstage-plugin-argo-cd-backend\` \n|\` oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-argo-cd-backend:<tag>\` \n" >> " $BUNDLED_PLUGINS_FILE "
660- echo -e " |*Scaffolder Backend ArgoCD*\n|1.8.1|\` ./dynamic-plugins/dist/roadiehq-scaffolder-backend-argocd-dynamic\` \n|\` oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-scaffolder-backend-argocd:<tag>\` \n" >> " $BUNDLED_PLUGINS_FILE "
661- echo -e " ${green} Found $migration_count community plugins to migrate${norm} "
662-
663- # Sort the migration table by plugin title and format for adoc
664- MIGRATION_TABLE_SORTED= " /tmp/migration_table_sorted_${BRANCH} .txt"
665- if [[ -f " $MIGRATION_TABLE_FILE " ]]; then
666- sort -t ' |' -k1,1 " $MIGRATION_TABLE_FILE " | while IFS=' ||' read -r key content; do
667- echo -e " $content \n" >> " $MIGRATION_TABLE_SORTED "
649+
650+ # Sort the community table by plugin title and format for adoc
651+ COMMUNITY_TABLE_SORTED= " /tmp/community_table_sorted_${BRANCH} .txt"
652+ if [[ -f " $COMMUNITY_TABLE_FILE " ]]; then
653+ sort -t ' |' -k1,1 " $COMMUNITY_TABLE_FILE " | while IFS=' ||' read -r key content; do
654+ echo -e " $content \n" >> " $COMMUNITY_TABLE_SORTED "
668655 done
669656 fi
670657
671658 # Generate the migration adoc file from template
672- migration_template = " ${0/ rhdh-supported-plugins.sh/ ref-community-plugins-migration-to-the-github-container-registry .template.adoc} "
673- migration_output = " ${0/ rhdh-supported-plugins.sh/ ref-community-plugins-migration-to-the-github-container-registry .adoc} "
659+ community_template = " ${0/ rhdh-supported-plugins.sh/ ref-community-plugins.template.adoc} "
660+ community_output = " ${0/ rhdh-supported-plugins.sh/ ref-community-plugins.adoc} "
674661
675- if [[ -f " $migration_template " ]]; then
662+ if [[ -f " $community_template " ]]; then
676663 # Replace placeholders in template
677- sed -e " /%%MIGRATION_TABLE%%/{r $MIGRATION_TABLE_SORTED " -e ' d;}' \
678- -e " /%%BUNDLED_PLUGINS%%/{r $BUNDLED_PLUGINS_FILE " -e ' d;}' \
679- -e " s/%%MIGRATION_COUNT%%/$migration_count /g" \
680- " $migration_template " > " $migration_output "
664+ sed -e " /%%COMMUNITY_TABLE_CONTENT%%/{r $COMMUNITY_TABLE_SORTED " -e ' d;}' \
665+ -e " s/%%COMMUNITY_TABLE_COUNT%%/$community_count /g" \
666+ " $community_template " > " $community_output "
681667
682- echo -e " ${green} Generated $migration_output with $migration_count migrated plugins${norm} "
668+ echo -e " ${green} Generated $community_output with $community_count migrated plugins${norm} "
683669 else
684- echo -e " ${red} [ERROR] Migration template not found: $migration_template ${norm} "
670+ echo -e " ${red} [ERROR] Community template not found: $community_template ${norm} "
685671 fi
686672
687673 # Cleanup temp files
688- rm -f " $MIGRATION_TABLE_FILE " " $MIGRATION_TABLE_SORTED " " $BUNDLED_PLUGINS_FILE "
674+ rm -f " $COMMUNITY_TABLE_FILE " " $COMMUNITY_TABLE_SORTED " " $BUNDLED_PLUGINS_FILE "
689675}
690676
691677# Call function if not skipped
692- if [[ $SKIP_MIGRATION -eq 0 ]]; then
693- generate_migration_table
678+ if [[ $SKIP_COMMUNITY_TABLE -eq 0 ]]; then
679+ generate_community_table
694680fi
695681
696682# summary of changes since last time
@@ -708,7 +694,7 @@ if [[ -f "${ENABLED_PLUGINS}.errors" ]]; then echo;sort -u "${ENABLED_PLUGINS}.e
708694# clean up CQA warnings
709695pushd " ${SCRIPT_DIR} " /../.. > /dev/null || exit
710696 for d in \
711- ref-community-plugins-migration-to-the-github-container-registry .adoc \
697+ ref-community-plugins.adoc \
712698 ref-deprecated-plugins.adoc \
713699 ref-other-installable-plugins.adoc \
714700 ref-supported-plugins.adoc \
0 commit comments