Skip to content

Commit

Permalink
Merge pull request #1962 from loft-sh/v6-docs
Browse files Browse the repository at this point in the history
WIP: DO NOT MERGE - docs v6
  • Loading branch information
LukasGentele authored Jun 21, 2022
2 parents 2a8a3c2 + 24d2807 commit da3db1a
Show file tree
Hide file tree
Showing 2,129 changed files with 46,247 additions and 64,497 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/docs.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"go.installDependenciesWhenBuilding": false,
"go.formatTool": "goimports",
"go.coverOnTestPackage": true,
"go.useLanguageServer": true
"go.useLanguageServer": true,
"editor.tabSize": 2
}
19 changes: 12 additions & 7 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,14 @@ echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,

// Add pipeline: dev
config.Pipelines["dev"] = &latest.Pipeline{
Run: `
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
}

// Add pipeline: dev
config.Pipelines["deploy"] = &latest.Pipeline{
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
build_images --all -t $(git describe --always) # 2. Build, tag (git commit hash) and push all images (see "images")
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"`,
}
Expand Down Expand Up @@ -670,9 +669,15 @@ func (cmd *InitCmd) addDevConfig(config *latest.Config, imageName, image string,
devConfig.Sync = []*latest.SyncConfig{}
}

devConfig.Sync = append(devConfig.Sync, &latest.SyncConfig{
syncConfig := &latest.SyncConfig{
Path: "./",
})
}

if _, err := os.Stat(".dockerignore"); err == nil {
syncConfig.UploadExcludeFile = ".dockerignore"
}

devConfig.Sync = append(devConfig.Sync, syncConfig)

devConfig.Terminal = &latest.Terminal{
Command: "./" + startScriptName,
Expand Down
1 change: 1 addition & 0 deletions docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.7
40 changes: 20 additions & 20 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,43 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern
### Installation

```
$ yarn
yarn
```

### Local Development

### Development
```
$ yarn start
yarn start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

### Build

### Production Build
```
$ yarn build
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

### Create New Major Version
```bash
yarn run docusaurus docs:version 5.x
```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy

### Generate CLI Reference
```bash
cd ../ # main project directory
go run ./docs/hack/cli/main.go
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
### Generate Partials For Config (devspace.yaml)
```bash
cd ../ # main project directory

go run ./docs/hack/config/partials/main.go
```

## Creating New Versions

### 1. Generate Command Docs
### Generate Schema For Config (devspace.yaml)
```bash
cd ../ # main project directory
go run -mod=vendor ./hack/gen-docs.go
```

### 2. Create Version
```bash
yarn run docusaurus docs:version 5.18
go run ./docs/hack/config/schemas/main.go
```
148 changes: 104 additions & 44 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__webpack_public_path__ = "/cli/"
__webpack_public_path__ = "/docs/"

const versions = require('./versions.json');
const resolveGlob = require('resolve-glob');

module.exports = {
title: 'DevSpace CLI | Documentation',
title: 'DevSpace | Documentation',
tagline: 'The tagline of my site',
url: 'https://devspace.sh',
baseUrl: __webpack_public_path__,
Expand All @@ -15,60 +15,55 @@ module.exports = {
disableSwitch: true
},
navbar: {
//hideOnScroll: true,
logo: {
alt: 'DevSpace',
src: '/img/logo-devspace.svg',
src: '/media/logos/devspace-logo-primary.svg',
href: 'https://devspace.sh/',
target: '_self'
},
items: [
{
to: 'versions',
label: `${versions[0]}`,
position: 'left',
className: 'version-link'
type: 'docsVersionDropdown',
position: 'left',
},
{
href: 'https://devspace.sh/',
label: 'Website',
position: 'left',
target: '_self'
href: 'https://devspace.sh/',
label: 'Website',
position: 'left',
target: '_self'
},
{
href: __webpack_public_path__ + 'docs/' + (process.env.NODE_ENV == 'production' ? '' : 'next/') + 'introduction',
label: 'Docs',
position: 'left',
target: '_self'
href: 'https://loft.sh/blog/tags/devspace',
label: 'Blog',
position: 'left',
target: '_self'
},
{
href: 'https://devspace.cloud/blog',
label: 'Blog',
position: 'left'
href: 'https://slack.loft.sh/',
className: 'slack-link',
'aria-label': 'Slack',
position: 'right',
},
{
href: 'https://slack.k8s.io/#devspace',
className: 'slack-link',
'aria-label': 'Slack',
position: 'right',
},
{
href: 'https://github.com/loft-sh/devspace',
className: 'github-link',
'aria-label': 'GitHub',
position: 'right',
href: 'https://github.com/loft-sh/devspace',
className: 'github-link',
'aria-label': 'GitHub',
position: 'right',
},
],
},
algolia: {
apiKey: "b9533b52dde7e23272dbd4211435c070",
apiKey: "9396b07e4ad34e90394fbfe79695d88d",
appId: "L1ZH1CZBMP",
indexName: "devspace-cli",
placeholder: "Search...",
algoliaOptions: {},
},
footer: {
style: 'light',
links: [],
copyright: `Copyright © ${new Date().getFullYear()} DevSpace Authors`,
copyright: `Copyright © DevSpace Authors <br/>DevSpace is an open-source project originally created by <a href="https://loft.sh/">Loft Labs, Inc.</a>`,
},
},
presets: [
Expand All @@ -77,27 +72,92 @@ module.exports = {
{
docs: {
path: 'pages',
routeBasePath: 'docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/loft-sh/devspace/edit/master/docs/',
},
showLastUpdateTime: true,
editUrl: 'https://github.com/loft-sh/devspace/edit/master/docs/',
lastVersion: "current",
versions: {
current: {
label: "6.x (Latest)",
path: ""
}
},
remarkPlugins: [
[
require('mdx-mermaid'),
{
mermaid: {
securityLevel: "loose",
theme: 'neutral',
themeVariables: {
primaryColor: '#00bdff',
lineColor: '#bdd6f3',
arrowheadColor: '#bdd6f3',
mainBkg: '#6c89ad',
contrast: '#3e5371',
textColor: '#fff',
primaryTextColor: '#fff',
secondaryTextColor: '#fff',
tertiaryTextColor: '#fff',
border1: 'transparent',
border2: 'transparent',
clusterBkg: 'transparent',
clusterBorder: '#bdd6f3',
edgeLabelBackground: '#bcd6f3',

},
flowchart: {
curve: 'basis',
nodeSpacing: 20,
rankSpacing: 50,
}
}
}
]
],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: resolveGlob.sync(['./src/css/**/*.scss']),
},
},
],
[
'redocusaurus',
{
specs: [
{
spec: 'schemas/config-openapi.json',
},
],
theme: {
primaryColor: '#00bdff',
redocOptions: {
hideDownloadButton: false,
disableSearch: true,
colors: {
border: {
dark: '#00bdff',
light: '#00bdff',
}
}
},
},
},
],
],
themes: [
'@saucelabs/theme-github-codeblock'
],
plugins: [
'docusaurus-plugin-sass',
'plugin-image-zoom',
],
scripts: [
{
src:
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
async: true,
},
{
src:
'https://devspace.sh/docs.js',
async: true,
src: 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
async: true,
},
],
clientModules: resolveGlob.sync(['./src/js/**/*.js']),
};
Loading

0 comments on commit da3db1a

Please sign in to comment.