Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1
# artifacts: false
# platforms: linux/amd64
FROM python:3.12-slim-bookworm

# CI args
ARG BRANCH
ARG BUILD_VERSION
ARG COMMIT
# note: BUILD_VERSION may be blank

ENV BRANCH=${BRANCH}
ENV BUILD_VERSION=${BUILD_VERSION}
ENV COMMIT=${COMMIT}

# Basic config
ARG DAILY_TASKS=true
ARG DAILY_RELEASES=true
Expand Down Expand Up @@ -54,6 +64,15 @@ VOLUME /data
WORKDIR /app/

COPY . .
RUN python -m pip install --no-cache-dir -r requirements.txt
RUN <<_SETUP
#!/bin/bash
set -e

# replace the version in the code
sed -i "s/version = '0.0.0'/version = '${BUILD_VERSION}'/g" src/common.py

# install dependencies
python -m pip install --no-cache-dir -r requirements.txt
_SETUP

CMD ["python", "-m", "src"]
2 changes: 1 addition & 1 deletion src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ def main():
reddit_bot.stop()


if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover
main()
1 change: 1 addition & 0 deletions src/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ def get_data_dir():
bot_name = f'{org_name}-Bot'
bot_url = 'https://app.lizardbyte.dev'
data_dir = get_data_dir()
version = '0.0.0'
4 changes: 3 additions & 1 deletion src/discord/cogs/base_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from discord.commands import Option

# local imports
from src.common import avatar, bot_name, org_name
from src.common import avatar, bot_name, org_name, version
from src.discord.views import DonateCommandView
from src.discord import cogs_common

Expand Down Expand Up @@ -37,6 +37,8 @@ async def help_command(
else:
description += await self.get_command_help(ctx=ctx, cmd=cmd)

description += f"\n\nVersion: {version}\n"

embed = discord.Embed(description=description, color=0xE5A00D)
embed.set_footer(text=bot_name, icon_url=avatar)

Expand Down