From fba6dcb70a0f0a679c6a0edcb903a965efa55e68 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Wed, 24 Jan 2024 17:53:46 +0100 Subject: [PATCH] Finished README for backend --- pkgs/clan-cli/README.md | 121 ++++++++++++++++++++++++++++++++++++++ pkgs/clan-cli/default.nix | 17 +----- pkgs/ui/README.md | 22 +++++-- 3 files changed, 139 insertions(+), 21 deletions(-) diff --git a/pkgs/clan-cli/README.md b/pkgs/clan-cli/README.md index 2551c32..a4a0174 100644 --- a/pkgs/clan-cli/README.md +++ b/pkgs/clan-cli/README.md @@ -33,6 +33,63 @@ And then run the docker file by executing: docker run -p 127.0.0.1:2979:2979 clan-docker:latest ``` +- To change parameters in the generated docker image edit the file : + [flake-module.nix at line 22](flake-module.nix) +- Documentation on `dockerTools.buildImage` you can find here: https://nix.dev/tutorials/nixos/building-and-running-docker-images.html + +## Docker build with UI changes + +If changes to the UI have been made, and you want them to propagate to the docker container edit the file: [../ui/nix/ui-assets.nix](../ui/nix/ui-assets.nix). +This is where a release version of the frontend is downloaded and integrated into the cli and the docker build. To do this first execute + +```bash +nix build .#ui --out-link ui-release +``` + +Make a tarball out of it called `ui-assets.tar.gz` + +```bash +tar -czvf ui-assets.tar.gz ui-release/lib/node_modules/clan-ui/out/ +``` + +Upload ui-assets.tar.gz to gitlab. To get the `GITLAB_TOKEN` go to [repo access tokens](https://git.tu-berlin.de/internet-of-services-lab/service-aware-network-front-end/-/settings/access_tokens) and generate one. Then execute + +```bash +export GITLAB_TOKEN="" +``` + +```bash +curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \ + --upload-file ./ui-assets.tar.gz \ + "https://git.tu-berlin.de/api/v4/projects/internet-of-services-lab%2Fservice-aware-network-front-end/packages/generic/ui-assets/1.0.0/ui-assets.tar.gz" +``` + +You can find your uploaded package at the [package registry](https://git.tu-berlin.de/internet-of-services-lab/service-aware-network-front-end/-/packages) + +And export the download url into a variable: + +``` +export url="https://git.tu-berlin.de/api/v4/projects/internet-of-services-lab%2Fservice-aware-network-front-end/packages/generic/ui-assets/1.0.0/ui-assets.tar.gz" +``` + +Now execute the command: + +```bash +cat > "../ui/nix/ui-assets.nix" <