diff --git a/docs.package.json b/docs.package.json index fc39c7dc10..ac3f78c235 100644 --- a/docs.package.json +++ b/docs.package.json @@ -14,7 +14,7 @@ { "repo": "SovereignCloudStack/cluster-stack-provider-openstack", "source": "docs", - "target": "docs/03-container/components/cluster-stacks/components", + "target": "docs/03-container/components", "label": "cluster-stack-provider-openstack" }, { @@ -121,19 +121,19 @@ { "repo": "SovereignCloudStack/csctl", "source": "docs/*.md", - "target": "docs/03-container/components/cluster-stacks/components", + "target": "docs/03-container/components", "label": "csctl" }, { "repo": "SovereignCloudStack/cluster-stacks", "source": "docs/*", - "target": "docs/03-container/components/cluster-stacks/components", + "target": "docs/03-container/components", "label": "cluster-stacks" }, { "repo": "SovereignCloudStack/cluster-stack-operator", "source": ["docs/*"], - "target": "docs/03-container/components/cluster-stacks/components", + "target": "docs/03-container/components", "label": "cluster-stack-operator" }, { diff --git a/getDocs.js b/getDocs.js index 92e15fae21..ce7c5223a3 100755 --- a/getDocs.js +++ b/getDocs.js @@ -14,34 +14,33 @@ const ghUrl = 'https://github.com/' repos.forEach((repo) => { const repoDir = `repo_to_be_edited/${repo.label}` - // Clone the repository - const cloneCommand = `git clone ${ghUrl + repo.repo} ${repoDir}` + // If the repo contains "cluster-stacks", clone the "restructure_container" branch + const branchOption = repo.repo.includes('cluster-stacks') + ? '--branch docs/r8 ' + : '' + const cloneCommand = `git clone ${branchOption}${ + ghUrl + repo.repo + } ${repoDir}` + + console.log(`Cloning: ${cloneCommand}`) execSync(cloneCommand) // Remove git folders - const removeGitCommand = `rm -rf ${repoDir}/.git` - execSync(removeGitCommand) + execSync(`rm -rf ${repoDir}/.git`) // Remove README files - const removeReadmeCommand = `find ${repoDir} -name "README.md" | xargs rm -f` - execSync(removeReadmeCommand) + execSync(`find ${repoDir} -name "README.md" | xargs rm -f`) // Create the docusaurus subdirectory const subDirPath = `${repo.target}/${repo.label}` fs.mkdirSync(subDirPath, { recursive: true }) // Copy docs content from A to B - // allow multiple sources here so the same repo need not be checked out multiple times - // however, it would be better if this script automatically grouped all entries by repo and then only - // checked out each repo only once; I leave this as a TODO because I don't fully grasp the meaning of - // label, for instance, and the label is used for the temporary repo directory let sources = Array.isArray(repo.source) ? repo.source : [repo.source] sources.forEach((source) => { - const copyDocsCommand = `cp -r ${repoDir}/${source} ${subDirPath}` - execSync(copyDocsCommand) + execSync(`cp -r ${repoDir}/${source} ${subDirPath}`) }) // Remove the cloned repository - const removeRepoCommand = 'rm -rf repo_to_be_edited' - execSync(removeRepoCommand) + execSync('rm -rf repo_to_be_edited') }) diff --git a/sidebarsDocs.js b/sidebarsDocs.js index 190a1f85dd..f6803d1fa1 100644 --- a/sidebarsDocs.js +++ b/sidebarsDocs.js @@ -74,123 +74,105 @@ const sidebarsDocs = { items: [ { type: 'category', - label: 'Overview', + label: 'Guides', link: { type: 'generated-index' }, - items: [ - // 'container/overview/architecture', - // 'container/overview/knowledge' - ] + items: ['container/guides/guide1'] }, { type: 'category', - label: 'Deployment Examples', + label: 'Components', link: { type: 'generated-index' }, items: [ + 'container/components/cluster-stacks/overview', + { + type: 'category', + label: 'Cluster Stack Operator', + link: { + type: 'generated-index' + }, + items: [ + 'container/components/cluster-stack-operator/architecture/overview', + 'container/components/cluster-stack-operator/topics/quickstart', + 'container/components/cluster-stack-operator/topics/troubleshoot', + 'container/components/cluster-stack-operator/develop/develop' + ] + }, + { + type: 'category', + label: 'Cluster Stack Provider OpenStack', + items: [ + 'container/components/cluster-stack-provider-openstack/docs/overview', + 'container/components/cluster-stack-provider-openstack/docs/quickstart', + 'container/components/cluster-stack-provider-openstack/docs/controllers', + 'container/components/cluster-stack-provider-openstack/docs/develop' + ] + }, + { + type: 'category', + label: 'csctl', + items: [ + 'container/components/csctl/overview', + 'container/components/csctl/quickstart', + 'container/components/csctl/getting_started', + 'container/components/csctl/developing-and-testing-csctl' + ] + }, { type: 'category', - label: 'Deployment A', + label: 'Container Registry', link: { type: 'generated-index' }, items: [ - // 'container/deployment-examples/a/index', - // 'container/deployment-examples/a/hardware', - // 'container/deployment-examples/a/software' + 'container/components/container-registry/docs/quickstart', + 'container/components/container-registry/docs/scs-deployment', + 'container/components/container-registry/docs/rate_limit', + 'container/components/container-registry/docs/upgrade', + 'container/components/container-registry/docs/backup_and_restore', + 'container/components/container-registry/docs/migration', + 'container/components/container-registry/docs/persistence', + 'container/components/container-registry/docs/ha-deployment' ] + }, + { + type: 'category', + label: 'Cluster Gen', + items: ['container/deployment-examples/a/software'] } ] }, { type: 'category', - label: 'Guides', - link: { - type: 'generated-index' - }, - items: [ - // 'container/guides/guide1' - ] - }, - { - type: 'category', - label: 'Components', + label: 'Deployment Examples', link: { type: 'generated-index' }, items: [ { type: 'category', - label: 'Cluster Stacks', - link: { - type: 'generated-index' - }, + label: 'Predefined Cluster Stacks', items: [ - 'container/components/cluster-stacks/components/cluster-stacks/overview', - { - type: 'category', - label: 'Cluster Stack Operator', - items: [ - 'container/components/cluster-stacks/components/cluster-stack-operator/architecture/overview', - 'container/components/cluster-stacks/components/cluster-stack-operator/topics/quickstart', - 'container/components/cluster-stacks/components/cluster-stack-operator/topics/troubleshoot', - 'container/components/cluster-stacks/components/cluster-stack-operator/develop/develop' - ] - }, - { - type: 'category', - label: 'Cluster Stack Provider OpenStack', - items: [ - 'container/components/cluster-stacks/components/cluster-stack-provider-openstack/docs/overview', - 'container/components/cluster-stacks/components/cluster-stack-provider-openstack/docs/quickstart', - 'container/components/cluster-stacks/components/cluster-stack-provider-openstack/docs/controllers', - 'container/components/cluster-stacks/components/cluster-stack-provider-openstack/docs/develop' - ] - }, { type: 'category', - label: 'csctl', + label: 'Openstack', items: [ - 'container/components/cluster-stacks/components/csctl/overview', - 'container/components/cluster-stacks/components/csctl/quickstart', - 'container/components/cluster-stacks/components/csctl/getting_started', - 'container/components/cluster-stacks/components/csctl/developing-and-testing-csctl' - ] - }, - { - type: 'category', - label: 'Predefined Cluster Stacks', - items: [ - { - type: 'category', - label: 'Openstack', - items: [ - 'container/components/cluster-stacks/components/cluster-stacks/providers/openstack/quickstart', - 'container/components/cluster-stacks/components/cluster-stacks/providers/openstack/configuration' - ] - } + 'container/components/cluster-stacks/providers/openstack/quickstart', + 'container/components/cluster-stacks/providers/openstack/configuration' ] } ] }, { type: 'category', - label: 'Container Registry', + label: 'Moin Cluster', link: { type: 'generated-index' }, - items: [ - 'container/components/container-registry/docs/quickstart', - 'container/components/container-registry/docs/scs-deployment', - 'container/components/container-registry/docs/rate_limit', - 'container/components/container-registry/docs/upgrade', - 'container/components/container-registry/docs/backup_and_restore', - 'container/components/container-registry/docs/migration', - 'container/components/container-registry/docs/persistence', - 'container/components/container-registry/docs/ha-deployment' - ] + items: ['container/deployment-examples/a/software'] } ] }