Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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"
},
{
Expand Down
27 changes: 13 additions & 14 deletions getDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
134 changes: 58 additions & 76 deletions sidebarsDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
]
}
Expand Down