Skip to content

Commit

Permalink
doc: install 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Nov 30, 2023
1 parent 696ebbd commit da007cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ content-type: application/json
}
```

`sandbox` is the name of the pre-configured sandbox, and `command` is the name of a command supported by that sandbox. See [Configuration](docs/config.md) for details.
`sandbox` is the name of the pre-configured sandbox, and `command` is the name of a command supported by that sandbox. See [Adding a sandbox](docs/add-sandbox.md) for details on how to add a new sandbox.

`files` is a map, where the key is a filename and the value is its contents. When executing a single file, it should either be named as the `command` expects, or be an empty string (as in the example above).

Expand Down
20 changes: 10 additions & 10 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ docker run hello-world

```sh
cd /opt/codapi
curl -L -o codapi.zip "https://api.github.com/repos/nalgeon/codapi/actions/artifacts/926428361/zip"
unzip -u codapi.zip
chmod +x build/codapi
rm -f codapi.zip
curl -L -O "https://github.com/nalgeon/codapi/releases/download/0.5.0/codapi_0.5.0_linux_amd64.tar.gz"
tar xvzf codapi_0.5.0_linux_amd64.tar.gz
chmod +x codapi
rm -f codapi_0.5.0_linux_amd64.tar.gz
```

6. Build Docker images (as codapi):
5. Build Docker images (as codapi):

```sh
cd /opt/codapi
make images
docker build --file images/alpine/Dockerfile --tag codapi/alpine:latest images/alpine/
```

7. Verify that Codapi starts without errors (as codapi):
6. Verify that Codapi starts without errors (as codapi):

```sh
cd /opt/codapi
./build/codapi
./codapi
```

Should print the `alpine` box and the `sh` command:
Expand All @@ -58,7 +58,7 @@ Should print the `alpine` box and the `sh` command:

Stop it with Ctrl+C.

8. Configure Codapi as systemd service (as root):
7. Configure Codapi as systemd service (as root):

```sh
mv /opt/codapi/codapi.service /etc/systemd/system/
Expand All @@ -82,7 +82,7 @@ codapi.service - Code playgrounds
...
```

9. Verify that Codapi is working:
8. Verify that Codapi is working:

```sh
curl -H "content-type: application/json" -d '{ "sandbox": "sh", "command": "run", "files": {"": "echo hello" }}' http://localhost:1313/v1/exec
Expand Down

0 comments on commit da007cc

Please sign in to comment.