Skip to content

Commit

Permalink
docs: add darkbot version printing in conf
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Dec 21, 2024
1 parent 6e49b70 commit 2268c7e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ jobs:
ssh-keyscan -H darkbot >> ~/.ssh/known_hosts | true
- name: Build image
run: docker build --tag darkwind8/darkbot:$SOURCE_NAME .
env:
SOURCE_NAME: ${{ env.SOURCE_NAME }}
run: docker build --build-arg "BUILD_VERSION=$SOURCE_NAME" --tag darkwind8/darkbot:$SOURCE_NAME .
- name: Push image
env:
SOURCE_NAME: ${{ env.SOURCE_NAME }}
run: |
docker push darkwind8/darkbot:$SOURCE_NAME
docker tag darkwind8/darkbot:$SOURCE_NAME darkwind8/darkbot:staging
docker push darkwind8/darkbot:staging
docker push darkwind8/darkbot:staging
- name: Install arm64 redock at server (not amd64 in my case)
run: ssh root@darkbot 'curl -L $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/darklab8/redock/releases/latest | sed "s/releases\/tag/releases\/download/")/redock-linux-arm64 -o /usr/local/bin/redock && chmod 777 /usr/local/bin/redock'

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ WORKDIR /code
RUN mkdir data
COPY --from=build /code/main main
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ARG BUILD_VERSION
ENV BUILD_VERSION="${BUILD_VERSION}"
CMD ./main run
3 changes: 3 additions & 0 deletions app/consoler/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package commands

import (
"fmt"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -343,6 +344,8 @@ func (r *rootCommands) CreateConfig() {
channel_id := r.GetChannelID()

is_enabled_channel, _ := r.channels.IsEnabled(channel_id)

sb.WriteString(fmt.Sprintln("darkbot version: ", os.Getenv("BUILD_VERSION")))
sb.WriteString(fmt.Sprintln("is channel ", channel_id, "connected = ", strconv.FormatBool(is_enabled_channel)))

if !is_enabled_channel {
Expand Down

0 comments on commit 2268c7e

Please sign in to comment.