Skip to content

Commit

Permalink
chore: release v0.47.0
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak committed Nov 29, 2024
1 parent d04dbcb commit 7082c6b
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 173 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "docs",
"license": "Apache-2.0",
"type": "module",
"version": "0.46.0",
"version": "0.47.0",
"scripts": {
"postinstall": "is-ci || husky",
"dev": "astro dev --host",
Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/installation/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ You can install Daytona by manually downloading the binary and placing it in you

```shell
# x86-64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-linux-amd64 -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-linux-amd64 -o daytona
# ARM64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-linux-arm64 -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-linux-arm64 -o daytona
```

:::
Expand All @@ -57,9 +57,9 @@ You can install Daytona by manually downloading the binary and placing it in you

```shell
# x86-64/Intel-based
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-darwin-amd64 -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-darwin-amd64 -o daytona
# ARM64/Apple Silicon
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-darwin-arm64 -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-darwin-arm64 -o daytona
```

:::
Expand All @@ -75,7 +75,7 @@ Install Daytona on Windows using the following PowerShell script:
```powershell
$architecture = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "amd64" } else { "arm64" }
md -Force "$Env:APPDATA\bin\daytona"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';
Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.46/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe";
Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.47/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe";
$env:Path += ";" + $Env:APPDATA + "\bin\daytona"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User);
daytona serve;
```
Expand All @@ -85,9 +85,9 @@ You can install Daytona by manually downloading the binary and placing it in you

```sh
# x86-64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-amd64.exe -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-amd64.exe -o daytona
# AArch64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-arm64.exe -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-arm64.exe -o daytona
```

:::
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/installation/method/script-powershell.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const partial = true
```powershell
$architecture = if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { "amd64" } else { "arm64" }
md -Force "$Env:APPDATA\bin\daytona"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';
Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.46/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe";
Invoke-WebRequest -URI "https://download.daytona.io/daytona/v0.47/daytona-windows-$architecture.exe" -OutFile "$Env:APPDATA\bin\daytona\daytona.exe";
$env:Path += ";" + $Env:APPDATA + "\bin\daytona"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User);
daytona serve;
```
Expand All @@ -21,9 +21,9 @@ You can install Daytona by manually downloading the binary and placing it in you

```powershell
# x86-64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-amd64.exe -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-amd64.exe -o daytona
# AArch64
curl -sf -L https://download.daytona.io/daytona/v0.46/daytona-windows-arm64.exe -o daytona
curl -sf -L https://download.daytona.io/daytona/v0.47/daytona-windows-arm64.exe -o daytona
```

</Aside>
10 changes: 10 additions & 0 deletions src/content/docs/tools/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,16 @@ Set the server configuration
| :-------- | :---------- |
| `200` | OK |

## GET /server/logs

List server log files

### Responses

| Status Code | Description |
| :-------- | :---------- |
| `200` | OK |

## POST /server/network-key

Generate a new authentication key
Expand Down
16 changes: 15 additions & 1 deletion src/content/docs/tools/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,22 @@ daytona server logs [flags]
__Flags__
| Long | Short | Description |
| :--- | :---- | :---------- |
| `--file` | | Read logs from local server log file |
| `--file` | | Read specific log file |
| `--follow` | `-f` | Follow logs |
| `--local` | `-l` | Read local server log files |
| `--help` | | help for daytona |

## daytona server logs list

Lists Daytona Server Log Files

```shell
daytona server logs list [flags]
```

__Flags__
| Long | Short | Description |
| :--- | :---- | :---------- |
| `--help` | | help for daytona |

## daytona server restart
Expand Down
178 changes: 89 additions & 89 deletions tools/update-cli-reference.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as _fs from "fs";
const fs = _fs.promises;
import { extname } from "path";
const __dirname = import.meta.dirname;
import * as _fs from 'fs'
import { extname } from 'path'
import { parseArgs } from 'util'
import * as yaml from 'yaml'

import { parseArgs } from "util";
import pkg from "../package.json" assert { type: "json" };
const fs = _fs.promises

import * as yaml from "yaml";
const __dirname = import.meta.dirname

// content to appear above the commands outline
const prepend = `---
Expand Down Expand Up @@ -35,119 +34,120 @@ You can access this documentation on a per-command basis by appending the \`--he
<Aside type="note">
This reference does not apply to the \`daytona\` command when run inside of a Workspace.
</Aside>
`;
`

// content to appear below the commands outline
const append = ``;
const append = ``

const notes = {
"daytona autocomplete": `\n<Aside type="note">
'daytona autocomplete': `\n<Aside type="note">
If using bash shell environment, make sure you have bash-completion installed in order to get full autocompletion functionality.
Linux Installation: \`\`\`sudo apt-get install bash-completion\`\`\`
macOS Installation: \`\`\`brew install bash-completion\`\`\`
</Aside>`};
</Aside>`,
}

async function fetchRawDocs(ref) {
const url = "https://api.github.com/repos/daytonaio/daytona/contents/hack/docs";
const request = await fetch(`${url}?ref=${ref}`);
const response = await request.json();
const url =
'https://api.github.com/repos/daytonaio/daytona/contents/hack/docs'
const request = await fetch(`${url}?ref=${ref}`)
const response = await request.json()

const files = [];
const files = []

for (const file of response) {
const { download_url } = file;
for (const file of response) {
const { download_url } = file

if (!download_url) continue;
if (!download_url) continue

const contentsReq = await fetch(download_url);
let contents = await contentsReq.text();
const contentsReq = await fetch(download_url)
let contents = await contentsReq.text()

contents = yaml.parse(contents);
contents = yaml.parse(contents)

files.push(contents);
}
files.push(contents)
}

return files;
return files
}

function flagToRow(flag) {
let { name, shorthand, usage } = flag;
let { name, shorthand, usage } = flag

name = `\`--${name}\``;
shorthand = shorthand ? `\`-${shorthand}\`` : "";
usage = usage ? usage : "";
name = `\`--${name}\``
shorthand = shorthand ? `\`-${shorthand}\`` : ''
usage = usage ? usage : ''

return `| ${name} | ${shorthand} | ${usage} |\n`;
return `| ${name} | ${shorthand} | ${usage} |\n`
}

function yamlToMarkdown(files) {
return files.map((rawDoc) => {
let output = "";
output += `## ${rawDoc.name}\n`;
output += `${rawDoc.synopsis}\n\n`;

if (!rawDoc.usage) {
rawDoc.usage = `${rawDoc.name} [flags]`;
}

output += "```shell\n";
output += `${rawDoc.usage}\n`;
output += "```\n\n";


output += "__Flags__\n";
output += "| Long | Short | Description |\n";
output += "| :--- | :---- | :---------- |\n";

if (rawDoc.options) {
for (const flag of rawDoc.options) {
let row = flagToRow(flag);
output += row;
}
}

if (rawDoc.inherited_options) {
for (const flag of rawDoc.inherited_options) {
let row = flagToRow(flag);
output += row;
}
}

if (notes[rawDoc.name]) {
output += notes[rawDoc.name];
}

output += "\n";

return output;
});
return files.map(rawDoc => {
let output = ''
output += `## ${rawDoc.name}\n`
output += `${rawDoc.synopsis}\n\n`

if (!rawDoc.usage) {
rawDoc.usage = `${rawDoc.name} [flags]`
}

output += '```shell\n'
output += `${rawDoc.usage}\n`
output += '```\n\n'

output += '__Flags__\n'
output += '| Long | Short | Description |\n'
output += '| :--- | :---- | :---------- |\n'

if (rawDoc.options) {
for (const flag of rawDoc.options) {
let row = flagToRow(flag)
output += row
}
}

if (rawDoc.inherited_options) {
for (const flag of rawDoc.inherited_options) {
let row = flagToRow(flag)
output += row
}
}

if (notes[rawDoc.name]) {
output += notes[rawDoc.name]
}

output += '\n'

return output
})
}

async function process(args) {
const { output, ref } = args.values;
console.log(`grabbing docs for ${ref}...`);
const { output, ref } = args.values
console.log(`grabbing docs for ${ref}...`)

// grab the files from GitHub
let files = await fetchRawDocs(ref);
let transformed = yamlToMarkdown(files);
// grab the files from GitHub
let files = await fetchRawDocs(ref)
let transformed = yamlToMarkdown(files)

const singleMarkdown = transformed.join("\n");
console.log(`writing to '${output}'...`);
await fs.writeFile(output, `${prepend}\n${singleMarkdown}\n${append}`);
console.log("done");
const singleMarkdown = transformed.join('\n')
console.log(`writing to '${output}'...`)
await fs.writeFile(output, `${prepend}\n${singleMarkdown}\n${append}`)
console.log('done')
}

const commandOpts = {
ref: {
type: "string",
default: `v${pkg.version}`
},
output: {
type: "string",
short: "o",
default: `${__dirname}/../src/content/docs/tools/cli.mdx`
}
ref: {
type: 'string',
default: `v0.47.0`,
},
output: {
type: 'string',
short: 'o',
default: `${__dirname}/../src/content/docs/tools/cli.mdx`,
},
}

const args = parseArgs({ options: commandOpts });
process(args);
const args = parseArgs({ options: commandOpts })
process(args)
Loading

0 comments on commit 7082c6b

Please sign in to comment.