-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
internal/renderer/testdata/.snapshots/TestParser_Renderer-happy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"document":[{"markdown":"# Tortuga API\n\nThe API built for [Tortuga Prototype](https://www.notion.so/statefulhq/Tortuga-Prototype-c406dd5fa1ad452dba15560a6cead5f9).\n\n\u003e **Warning!** All code snippets below assume you're in the **`./api`** directory.\n\n## Start\n\nFirst π, install dev dependencies:"},{"attributes":{"name":"install"},"content":"brew bundle\n","description":"First π, install dev dependencies:","language":"sh","lines":["brew bundle"]},{"markdown":"Deploy site to Vercel"},{"content":"https://vercel.com/stateful/stateful-com\n","description":"Deploy site to Vercel","language":"Vercel","lines":["https://vercel.com/stateful/stateful-com"]},{"markdown":"Next run dependencies:"},{"attributes":{"name":"docker-compose"},"content":"$ docker compose up -d\n","description":"Next run dependencies:","language":"sh","lines":["docker compose up -d"]},{"markdown":"Then you should be able to successfully run:"},{"attributes":{"name":"run"},"content":"$ echo \"Running\"\n$ go run ./cmd/api/main.go\n2022/05/10 12:18:18 starting to listen on: :8080\n","description":"Then you should be able to successfully run:","language":"sh","lines":["echo \"Running\"","go run ./cmd/api/main.go"]},{"markdown":"Development\n\n\u003e Currently, VS Code and Go extension require opening `./api` as a project root directory to work properly.\n\u003e You can use Workspaces to open the project root directory and `./api` as a second folder.\n\nTry using [watchexec](https://github.com/watchexec/watchexec) to autoreload."},{"attributes":{"name":"watch"},"content":"watchexec -r -e go -- go run ./cmd/api/main.go\n","description":"Try using [watchexec](https://github.com/watchexec/watchexec) to autoreload.","language":"sh","lines":["watchexec -r -e go -- go run ./cmd/api/main.go"]},{"markdown":"Deployment\n\nDeployments are managed with Terraform. Go to [infra](../infra) to learn how to run it.\n\n[infra](../infra) automatically discovers if source files of the api changed. If so, it triggers a Docker image build and updates a Cloud Run service.\n\n## Database\n\nIt uses PostgreSQL.\n\n### Migrations\n\n[Atlas CLI](https://atlasgo.io/cli/getting-started/setting-up) is used to manage database migrations in a declarative way.\n\nMigrations are run automatically by the API server process.\n\nIn a case you want to run them manually and re-use Postgres from Docker Compose:"},{"attributes":{"name":"migrate"},"content":"$ atlas schema apply -u \"postgres://postgres:postgres@localhost:15432/tortuga?sslmode=disable\" -f atlas.hcl\n","description":"In a case you want to run them manually and re-use Postgres from Docker Compose:","language":"sh","lines":["atlas schema apply -u \"postgres://postgres:postgres@localhost:15432/tortuga?sslmode=disable\" -f atlas.hcl"]},{"markdown":"API\n\n\u003e Each insert accepts also `user_id` which is nullable for now.\n\u003e All endpoints implement also `GET` method to return all collected results so far starting from the most recent.\n\n### Tasks\n\nInserting task execution metadata:"},{"attributes":{"name":"post-task"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/tasks/ -d '{\"duration\": \"10s\", \"exit_code\": 0, \"name\": \"Run task\", \"runbook_name\": \"RB 1\", \"runbook_run_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\", \"start_time\": \"2022-05-05T04:12:43Z\", \"command\": \"/bin/sh\", \"args\": \"echo hello\", \"feedback\": \"this is cool!\", \"extra\": \"{\\\"hello\\\": \\\"world\\\"}\"}'\n{\"id\":\"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}\n","description":"Inserting task execution metadata:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/tasks/ -d '{\"duration\": \"10s\", \"exit_code\": 0, \"name\": \"Run task\", \"runbook_name\": \"RB 1\", \"runbook_run_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\", \"start_time\": \"2022-05-05T04:12:43Z\", \"command\": \"/bin/sh\", \"args\": \"echo hello\", \"feedback\": \"this is cool!\", \"extra\": \"{\\\"hello\\\": \\\"world\\\"}\"}'"]},{"markdown":"A task can be patched:"},{"attributes":{"name":"patch-task"},"content":"$ curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/tasks/6e975f1b-0c0f-4765-b24a-2aa87b901c06/ -d '{\"duration\": \"15s\", \"exit_code\": 1}'\n{\"id\":\"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}\n","description":"A task can be patched:","language":"sh","lines":["curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/tasks/6e975f1b-0c0f-4765-b24a-2aa87b901c06/ -d '{\"duration\": \"15s\", \"exit_code\": 1}'"]},{"markdown":"Feedback\n\nInserting feedback can optionally take a `task_id`:"},{"attributes":{"name":"post-feedback"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/feedback/ -d '{\"message\": \"My feedback!\", \"task_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}'\n{\"id\":\"a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f\"}\n","description":"Inserting feedback can optionally take a `task_id`:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/feedback/ -d '{\"message\": \"My feedback!\", \"task_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}'"]},{"markdown":"Feedback can be patched:"},{"attributes":{"name":"patch-feedback"},"content":"$ curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/feedback/a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f/ -d '{\"message\": \"Modified!\"}'\n{\"id\":\"a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f\"}\n","description":"Feedback can be patched:","language":"sh","lines":["curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/feedback/a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f/ -d '{\"message\": \"Modified!\"}'"]},{"markdown":"Editor configs\n\nInserting editor configs:"},{"attributes":{"name":"post-editor-config"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/editor-configs/ -d '{\"data\": \"{\\\"files.autoSave\\\": \\\"afterDelay\\\"}\"}'\n{\"id\":\"4c7d6fb5-eb53-44f7-8883-80f276af65a1\"}\n","description":"Inserting editor configs:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/editor-configs/ -d '{\"data\": \"{\\\"files.autoSave\\\": \\\"afterDelay\\\"}\"}'"]}]} | ||
{"document":[{"markdown":"# Tortuga API\n\nThe API built for [Tortuga Prototype](https://www.notion.so/statefulhq/Tortuga-Prototype-c406dd5fa1ad452dba15560a6cead5f9).\n\n\u003e **Warning!** All code snippets below assume you're in the **`./api`** directory.\n\n## Start\n\nFirst π, install dev dependencies:"},{"attributes":{"name":"install"},"content":"brew bundle\n","description":"First π, install dev dependencies:","language":"sh","lines":["brew bundle"]},{"markdown":"Deploy site to Vercel"},{"content":"https://vercel.com/stateful/stateful-com\n","description":"Deploy site to Vercel","language":"Vercel","lines":["https://vercel.com/stateful/stateful-com"]},{"markdown":"Next run dependencies:"},{"attributes":{"name":"docker-compose"},"content":"$ docker compose up -d\n","description":"Next run dependencies:","language":"sh","lines":["docker compose up -d"]},{"markdown":"Then you should be able to successfully run:"},{"attributes":{"name":"run"},"content":"$ echo \"Running\"\n$ go run ./cmd/api/main.go\n2022/05/10 12:18:18 starting to listen on: :8080\n","description":"Then you should be able to successfully run:","language":"sh","lines":["echo \"Running\"","go run ./cmd/api/main.go"]},{"markdown":"## Development\n\n\u003e Currently, VS Code and Go extension require opening `./api` as a project root directory to work properly.\n\u003e You can use Workspaces to open the project root directory and `./api` as a second folder.\n\nTry using [watchexec](https://github.com/watchexec/watchexec) to autoreload."},{"attributes":{"name":"watch"},"content":"watchexec -r -e go -- go run ./cmd/api/main.go\n","description":"Try using [watchexec](https://github.com/watchexec/watchexec) to autoreload.","language":"sh","lines":["watchexec -r -e go -- go run ./cmd/api/main.go"]},{"markdown":"## Deployment\n\nDeployments are managed with Terraform. Go to [infra](../infra) to learn how to run it.\n\n[infra](../infra) automatically discovers if source files of the api changed. If so, it triggers a Docker image build and updates a Cloud Run service.\n\n## Database\n\nIt uses PostgreSQL.\n\n### Migrations\n\n[Atlas CLI](https://atlasgo.io/cli/getting-started/setting-up) is used to manage database migrations in a declarative way.\n\nMigrations are run automatically by the API server process.\n\nIn a case you want to run them manually and re-use Postgres from Docker Compose:"},{"attributes":{"name":"migrate"},"content":"$ atlas schema apply -u \"postgres://postgres:postgres@localhost:15432/tortuga?sslmode=disable\" -f atlas.hcl\n","description":"In a case you want to run them manually and re-use Postgres from Docker Compose:","language":"sh","lines":["atlas schema apply -u \"postgres://postgres:postgres@localhost:15432/tortuga?sslmode=disable\" -f atlas.hcl"]},{"markdown":"## API\n\n\u003e Each insert accepts also `user_id` which is nullable for now.\n\u003e All endpoints implement also `GET` method to return all collected results so far starting from the most recent.\n\n### Tasks\n\nInserting task execution metadata:"},{"attributes":{"name":"post-task"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/tasks/ -d '{\"duration\": \"10s\", \"exit_code\": 0, \"name\": \"Run task\", \"runbook_name\": \"RB 1\", \"runbook_run_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\", \"start_time\": \"2022-05-05T04:12:43Z\", \"command\": \"/bin/sh\", \"args\": \"echo hello\", \"feedback\": \"this is cool!\", \"extra\": \"{\\\"hello\\\": \\\"world\\\"}\"}'\n{\"id\":\"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}\n","description":"Inserting task execution metadata:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/tasks/ -d '{\"duration\": \"10s\", \"exit_code\": 0, \"name\": \"Run task\", \"runbook_name\": \"RB 1\", \"runbook_run_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\", \"start_time\": \"2022-05-05T04:12:43Z\", \"command\": \"/bin/sh\", \"args\": \"echo hello\", \"feedback\": \"this is cool!\", \"extra\": \"{\\\"hello\\\": \\\"world\\\"}\"}'"]},{"markdown":"A task can be patched:"},{"attributes":{"name":"patch-task"},"content":"$ curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/tasks/6e975f1b-0c0f-4765-b24a-2aa87b901c06/ -d '{\"duration\": \"15s\", \"exit_code\": 1}'\n{\"id\":\"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}\n","description":"A task can be patched:","language":"sh","lines":["curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/tasks/6e975f1b-0c0f-4765-b24a-2aa87b901c06/ -d '{\"duration\": \"15s\", \"exit_code\": 1}'"]},{"markdown":"### Feedback\n\nInserting feedback can optionally take a `task_id`:"},{"attributes":{"name":"post-feedback"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/feedback/ -d '{\"message\": \"My feedback!\", \"task_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}'\n{\"id\":\"a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f\"}\n","description":"Inserting feedback can optionally take a `task_id`:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/feedback/ -d '{\"message\": \"My feedback!\", \"task_id\": \"6e975f1b-0c0f-4765-b24a-2aa87b901c06\"}'"]},{"markdown":"Feedback can be patched:"},{"attributes":{"name":"patch-feedback"},"content":"$ curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/feedback/a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f/ -d '{\"message\": \"Modified!\"}'\n{\"id\":\"a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f\"}\n","description":"Feedback can be patched:","language":"sh","lines":["curl -X PATCH -H \"Content-Type: application/json\" localhost:8080/feedback/a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f/ -d '{\"message\": \"Modified!\"}'"]},{"markdown":"### Editor configs\n\nInserting editor configs:"},{"attributes":{"name":"post-editor-config"},"content":"$ curl -XPOST -H \"Content-Type: application/json\" localhost:8080/editor-configs/ -d '{\"data\": \"{\\\"files.autoSave\\\": \\\"afterDelay\\\"}\"}'\n{\"id\":\"4c7d6fb5-eb53-44f7-8883-80f276af65a1\"}\n","description":"Inserting editor configs:","language":"sh","lines":["curl -XPOST -H \"Content-Type: application/json\" localhost:8080/editor-configs/ -d '{\"data\": \"{\\\"files.autoSave\\\": \\\"afterDelay\\\"}\"}'"]}]} |
1 change: 1 addition & 0 deletions
1
internal/renderer/testdata/.snapshots/TestParser_Renderer-linesless
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"document":[{"markdown":"To deploy to production, run:"},{"content":"deployctl deploy --project=runme main.ts\n","description":"To deploy to production, run:","language":"sh","lines":["deployctl deploy --project=runme main.ts"]},{"markdown":"\u003cp align=\"center\"\u003e\u003csmall\u003eCopyright 2022 Β© \u003ca href=\"http://stateful.com/\"\u003eStateful\u003c/a\u003e β Apache 2.0 License\u003c/small\u003e\u003c/p\u003e"}]} |