From 3eb3db0a9fd9c87a091746a52cb6bfc5c339a32f Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Fri, 29 Aug 2025 20:19:25 +0200 Subject: [PATCH 1/3] docs: add contributing.md and additional instructions on building the docs. --- CONTRIBUTING.md | 28 ++++++++++++++++++++++++++++ src/docs/README.md | 21 ++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..042b96b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# Contributing + +Contributions are welcome, including bug reports, implementing features or writing documentation. + +## Dev Environment Setup + +The recommended way is: + +1. Build the docker image, setting the version to a number of your choosing + ```bash + docker build --network=host --tag bbernhard/signal-cli-rest-api: . + ``` +2. Adjust the `docker-compose.yml` + * Replace the `image: bbernhard/signal-cli-rest-api:latest` for `image: bbernhard/signal-cli-rest-api:` + * Add the version to the environment: + ```yml + environment: + - BUILD_VERSION= + ``` +3. Run the image + ```bash + docker compose up + ``` +4. Make code changes and repeat steps 1 to 3 + +## Building the documentation + +Follow the instructions in the docs [readme page](./src/docs/README.md). \ No newline at end of file diff --git a/src/docs/README.md b/src/docs/README.md index eb559cb..ba491b6 100644 --- a/src/docs/README.md +++ b/src/docs/README.md @@ -10,4 +10,23 @@ Or, if you have `swag` installed: ```bash swag init -``` \ No newline at end of file +``` + +Then run the app in `/src` + +```bash +go run main.go +``` + +Or with the docker compose in the root of the repository +```bash +docker compose up +``` + +And navigate to the following address to view the docs + +http://127.0.0.1:8080/swagger/index.html + +On docker you'll get a Network error, replace the IP for the docker internal IP in the error, e.g: + +http://172.18.0.2:8080/swagger/index.html \ No newline at end of file From 1cd6b3afcd244e01b8c8f4a91905b1a67cc24302 Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Thu, 4 Sep 2025 22:16:47 +0100 Subject: [PATCH 2/3] Simplify dev environment setup instructions --- CONTRIBUTING.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 042b96b..736cf22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,24 +4,26 @@ Contributions are welcome, including bug reports, implementing features or writi ## Dev Environment Setup -The recommended way is: +The recommended way is to use docker compose: -1. Build the docker image, setting the version to a number of your choosing +1. In the `docker-compose.yml` replace the `image: bbernhard/signal-cli-rest-api:latest` for `build: "."` + +The development workflow is: + +1. Make changes in the source code. +2. Build the image and run a container. ```bash - docker build --network=host --tag bbernhard/signal-cli-rest-api: . + docker compose build ``` -2. Adjust the `docker-compose.yml` - * Replace the `image: bbernhard/signal-cli-rest-api:latest` for `image: bbernhard/signal-cli-rest-api:` - * Add the version to the environment: - ```yml - environment: - - BUILD_VERSION= - ``` -3. Run the image ```bash docker compose up ``` -4. Make code changes and repeat steps 1 to 3 +3. Test the changes. +4. Bring the container down. + ```bash + docker compose down + ``` +4. Repeat as many times as needed. ## Building the documentation From ae342a440390ab264d566261536462167831c16a Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Thu, 4 Sep 2025 22:17:04 +0100 Subject: [PATCH 3/3] Better wording in readme in docs --- src/docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/README.md b/src/docs/README.md index ba491b6..0117eff 100644 --- a/src/docs/README.md +++ b/src/docs/README.md @@ -18,12 +18,12 @@ Then run the app in `/src` go run main.go ``` -Or with the docker compose in the root of the repository +Or with docker compose in the root of the repository ```bash docker compose up ``` -And navigate to the following address to view the docs +Then navigate to the following address to view the docs http://127.0.0.1:8080/swagger/index.html