diff --git a/README.md b/README.md index cc436ab..04ff53e 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# mini-loader \ No newline at end of file +# mini-loader + +[Getting started](./docs/getting-started.md) \ No newline at end of file diff --git a/docs/creating-an-api.md b/docs/creating-an-api.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/first-workload.md b/docs/first-workload.md new file mode 100644 index 0000000..9045708 --- /dev/null +++ b/docs/first-workload.md @@ -0,0 +1,29 @@ +First let’s install the CLI, which allow us to interact with a mini-loader server, but also run our workloads locally to validate that they are working + +```bash +npm install -g @morten-olsen/mini-loader-cli +``` + +Next we need a script - let’s start simple with a script which will just output a single artifact called “hello” + +```javascript +import { artifacts } from "@morten-olsen/mini-loader"; + +artifacts.create('hello', 'world'); +``` + +We save our script as `script.mjs` + +Note that we are referencing a package we don’t have. mini-loader support automatically downloading packages when it prepares the script. We could also have initialised a node project and installed the dependency (useful if you are using typescript and want typings) + +Next we want to execute our script locally to validate that it actually works as we intended + +```bash +mini-loader local run script.mjs -ai +``` + +Note the `-ai` which tells the CLI to download any packages referenced when it bundles the script + +This should output that the script indeed created a new artifact named “hello” + +[Next: setting up the server](./setup-server.md) \ No newline at end of file diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..a09ad1d --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1 @@ +[Next: create a workload](./first-workload.md) \ No newline at end of file diff --git a/docs/interacting-with-server.md b/docs/interacting-with-server.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/managing-secrets.md b/docs/managing-secrets.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/setting-up-oidc.md b/docs/setting-up-oidc.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/setup-server.md b/docs/setup-server.md new file mode 100644 index 0000000..6ed164e --- /dev/null +++ b/docs/setup-server.md @@ -0,0 +1,35 @@ +The easiest way to get up and running is using docker + +First let’s deploy the container + +```bash +docker run -p 4500:4500 -n mini-loader ghcr.io/morten-olsen/mini-loader:main +``` + +That’s it, your server should be running + +```bash +curl http://localhost:4500/health +``` + +Next we need to authorize. Since we have not setup authorization, we need to use our container to issue a token. + +```bash +docker exec mini-loader mini-loader create-token +``` + +Which will output a token for us to use + +Now we need to authorize our CLI client before we can start to interact with our server. + +```bash +mini-loader auth login https://localhost:4500 +``` + +Verify that the CLI is working by fetching the loads + +```bash +mini-loader loads ls +``` + +[Next: interacting with the server](./interacting-with-server.md]