doc: install 0.5.0
This commit is contained in:
@@ -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).
|
`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).
|
||||||
|
|
||||||
|
|||||||
@@ -26,24 +26,24 @@ docker run hello-world
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd /opt/codapi
|
cd /opt/codapi
|
||||||
curl -L -o codapi.zip "https://api.github.com/repos/nalgeon/codapi/actions/artifacts/926428361/zip"
|
curl -L -O "https://github.com/nalgeon/codapi/releases/download/0.5.0/codapi_0.5.0_linux_amd64.tar.gz"
|
||||||
unzip -u codapi.zip
|
tar xvzf codapi_0.5.0_linux_amd64.tar.gz
|
||||||
chmod +x build/codapi
|
chmod +x codapi
|
||||||
rm -f codapi.zip
|
rm -f codapi_0.5.0_linux_amd64.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Build Docker images (as codapi):
|
5. Build Docker images (as codapi):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd /opt/codapi
|
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
|
```sh
|
||||||
cd /opt/codapi
|
cd /opt/codapi
|
||||||
./build/codapi
|
./codapi
|
||||||
```
|
```
|
||||||
|
|
||||||
Should print the `alpine` box and the `sh` command:
|
Should print the `alpine` box and the `sh` command:
|
||||||
@@ -58,7 +58,7 @@ Should print the `alpine` box and the `sh` command:
|
|||||||
|
|
||||||
Stop it with Ctrl+C.
|
Stop it with Ctrl+C.
|
||||||
|
|
||||||
8. Configure Codapi as systemd service (as root):
|
7. Configure Codapi as systemd service (as root):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mv /opt/codapi/codapi.service /etc/systemd/system/
|
mv /opt/codapi/codapi.service /etc/systemd/system/
|
||||||
@@ -82,7 +82,7 @@ codapi.service - Code playgrounds
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
9. Verify that Codapi is working:
|
8. Verify that Codapi is working:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -H "content-type: application/json" -d '{ "sandbox": "sh", "command": "run", "files": {"": "echo hello" }}' http://localhost:1313/v1/exec
|
curl -H "content-type: application/json" -d '{ "sandbox": "sh", "command": "run", "files": {"": "echo hello" }}' http://localhost:1313/v1/exec
|
||||||
|
|||||||
Reference in New Issue
Block a user