Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
update render dockerfiles, update botway docker-init command
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Sep 21, 2022
1 parent 5212cfd commit 54d0bcf
Show file tree
Hide file tree
Showing 27 changed files with 71 additions and 23 deletions.
4 changes: 3 additions & 1 deletion cmd/app/docker-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ func DockerInitCMD() *cobra.Command {
cmd := &cobra.Command{
Use: "docker-init",
Short: "Initialize ~/.botway for docker containers",
Run: func(cmd *cobra.Command, args []string) { initx.DockerInit() },
Run: func(cmd *cobra.Command, args []string) {
initx.DockerInit()
},
}

return cmd
Expand Down
8 changes: 5 additions & 3 deletions docker/bfs.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ RUN addgroup --gid 1000 botway \

RUN go install github.com/go-task/task/v3/cmd/task@latest

RUN git clone https://github.com/abdfnx/botway && \
cd botway && \
task bfs
WORKDIR /botway-src

COPY . .

RUN task bfs

COPY ./docker/entry.sh /usr/local/bin/docker-entrypoint.sh

Expand Down
11 changes: 2 additions & 9 deletions dockerfiles/railway/poetry.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,9 @@ RUN apk update && \
# RUN apk add PACKAGE_NAME

# Install poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3

ENV PATH="/root/.poetry/bin:$PATH"

RUN echo 'eval "$(poetry env install -q)"' >> ~/.bashrc
RUN echo 'eval "$(poetry env shell -q)"' >> ~/.bashrc

RUN /bin/bash -c "bash"
RUN pip install poetry

RUN poetry config virtualenvs.create false
RUN poetry install --no-dev
RUN poetry install

ENTRYPOINT ["python3", "./src/main.py"]
2 changes: 2 additions & 0 deletions dockerfiles/render/bun.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/c-discord.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/cargo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/cmake-discord.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/cmake-telegram.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/crystal.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/csharp.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/dart.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/deno.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/fleet.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/go.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/gradle.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/nim.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/npm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/php.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/pip.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/pipenv.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/pnpm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
13 changes: 4 additions & 9 deletions dockerfiles/render/poetry.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand All @@ -19,16 +21,9 @@ COPY --from=bw /root/.botway /root/.botway
COPY . .

# Install poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3

ENV PATH="/root/.poetry/bin:$PATH"

RUN echo 'eval "$(poetry env install -q)"' >> ~/.bashrc
RUN echo 'eval "$(poetry env shell -q)"' >> ~/.bashrc

RUN /bin/bash -c "bash"
RUN pip install poetry

RUN poetry config virtualenvs.create false
RUN poetry install --no-dev
RUN poetry install

ENTRYPOINT ["python3", "./src/main.py"]
2 changes: 2 additions & 0 deletions dockerfiles/render/ruby.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/swift.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/render/yarn.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM botwayorg/botway:latest AS bw

ARG {{.BotSecrets}}

COPY . .

RUN botway docker-init
Expand Down
2 changes: 1 addition & 1 deletion packages/botwaygo
14 changes: 14 additions & 0 deletions templates/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ import (
"github.com/charmbracelet/lipgloss"
)

func BotSecrets(templateName string) string {
if strings.Contains(templateName, "discord") {
return "DISCORD_TOKEN DISCORD_CLIENT_ID\n# You can add guild ids of your servers by adding ARG SERVER_NAME_GUILD_ID"
} else if strings.Contains(templateName, "telegram") {
return "TELEGRAM_TOKEN"
} else if strings.Contains(templateName, "slack") {
return "SLACK_TOKEN SLACK_APP_TOKEN SLACK_SIGNING_SECRET"
}

return ""
}

func Content(arg, templateName, botName string) string {
org := "botwayorg"

Expand Down Expand Up @@ -49,6 +61,8 @@ func Content(arg, templateName, botName string) string {

respone = strings.ReplaceAll(respone, "{{.Author}}", author)

respone = strings.ReplaceAll(respone, "{{.BotSecrets}}", BotSecrets(templateName))

return respone
}

Expand Down

0 comments on commit 54d0bcf

Please sign in to comment.