From ebf75414bbe6aa0623cd6da0928045e1d400fb55 Mon Sep 17 00:00:00 2001 From: nightnoryu Date: Wed, 14 May 2025 12:56:25 +0300 Subject: [PATCH] Update build instructions, remove unnecessary wrappers --- README.md | 17 +++++++++-------- bin/.gitignore | 1 - bin/a3abrewkit | 21 --------------------- bin/a3acompose | 12 ------------ 4 files changed, 9 insertions(+), 42 deletions(-) delete mode 100755 bin/a3abrewkit delete mode 100755 bin/a3acompose diff --git a/README.md b/README.md index 4c0191f..631bf6f 100644 --- a/README.md +++ b/README.md @@ -13,24 +13,25 @@ Prerequisites: 1. Linux 2. Git 3. Docker +4. (optional) [BrewKit](https://github.com/ispringtech/brewkit) Firstly, clone the repository into your `$GOPATH`: ```shell mkdir -p $GOPATH/src/github.com/nightnoryu cd $GOPATH/src/github.com/nightnoryu - git clone git@github.com:nightnoryu/anon3anon.git cd anon3anon ``` -Then build the binary: +Then build the project: ```shell -bin/a3abrewkit build -``` +brewkit build -This script will download a [brewkit build system](https://github.com/ispringtech/brewkit) binary and put it in the `bin` directory of the project. +# Alternatively, if you don't want to use BrewKit, you can do it the old-fashioned way: +# go build -o ./bin/anon3anon ./cmd/anon3anon +``` After that, copy the `docker-compose.override.example.yml` to `docker-compose.override.yml` and set the environment variables: @@ -42,15 +43,15 @@ services: OWNER_CHAT_ID: 123 # ID of your chat with your bot ``` -And you're set! Use the provided `docker compose` wrapper script to manage the application: +And you're set! Use `docker compose` to manage the application: ```shell # Start -bin/a3acompose up -d +docker compose up -d # Restart to apply changes docker restart anon3anon # Stop -bin/a3acompose down +docker compose down ``` diff --git a/bin/.gitignore b/bin/.gitignore index 4e53720..26b2dfe 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,2 +1 @@ /anon3anon -/brewkit diff --git a/bin/a3abrewkit b/bin/a3abrewkit deleted file mode 100755 index 5d86fa6..0000000 --- a/bin/a3abrewkit +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -WORK_DIR=$(dirname "$(dirname "$(readlink -f "$0")")") - -BREWKIT_VERSION="v1.0.0" -BREWKIT_URL="https://github.com/ispringtech/brewkit/releases/download/$BREWKIT_VERSION/brewkit_amd64" -BREWKIT_BINARY="bin/brewkit" - -pushd "$WORK_DIR" >/dev/null - -if [[ ! -f "$BREWKIT_BINARY" ]]; then - echo "installing brewkit..." - wget -q -O "$BREWKIT_BINARY" "$BREWKIT_URL" - chmod +x "$BREWKIT_BINARY" -fi - -"$WORK_DIR/$BREWKIT_BINARY" "$@" - -popd >/dev/null diff --git a/bin/a3acompose b/bin/a3acompose deleted file mode 100755 index bc286fc..0000000 --- a/bin/a3acompose +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit - -WORK_DIR=$(dirname "$(dirname "$(readlink -f "$0")")") -PROJECT_NAME=$(basename "$WORK_DIR") - -pushd "$WORK_DIR" >/dev/null - -docker compose -p "$PROJECT_NAME" "$@" - -popd >/dev/null