-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated CLI, compatibility watch script & docker files
- Loading branch information
1 parent
a543c4b
commit b139c78
Showing
7 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Dev Tests | ||
|
||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bun: | ||
name: Test on Bun v1.1.34 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: 1.1.34 | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Start the bot | ||
env: | ||
BOT_MODE: test | ||
run: bun run src/index.test.ts | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
services: | ||
bot: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: ${BOT_NAME} | ||
restart: always | ||
volumes: | ||
<%- | ||
client === "sqlite3" ? "- ./data:/data" : | ||
client === "pg" ? "- ./data:/var/lib/postgresql/data" : | ||
client === "mysql" ? "- ./data:/var/lib/mysql" : "" | ||
%> | ||
<% | ||
if (client === "sqlite3") { | ||
%> | ||
sqlite: | ||
image: sqlite | ||
container_name: sqlite | ||
volumes: | ||
- ./data:/data | ||
<% | ||
} else if (client === "pg") { | ||
%> | ||
postgres: | ||
image: postgres | ||
container_name: postgres | ||
environment: | ||
- POSTGRES_USER=${DB_USER} | ||
- POSTGRES_PASSWORD=${DB_PASSWORD} | ||
- POSTGRES_DB=${DB_DATABASE} | ||
volumes: | ||
- ./data:/var/lib/postgresql/data | ||
<% if (process.env.DB_PORT) { %> | ||
ports: | ||
- "${DB_PORT}:5432" | ||
<% } %> | ||
<% | ||
} else if (client === "mysql") { | ||
%> | ||
mysql: | ||
image: mysql | ||
container_name: mysql | ||
environment: | ||
- MYSQL_USER=${DB_USER} | ||
- MYSQL_PASSWORD=${DB_PASSWORD} | ||
- MYSQL_DATABASE=${DB_DATABASE} | ||
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD} | ||
volumes: | ||
- ./data:/var/lib/mysql | ||
<% if (process.env.DB_PORT) { %> | ||
ports: | ||
- "${DB_PORT}:3306" | ||
<% } %> | ||
<% | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<% if (runtime === 'bun') { | ||
%>FROM oven/bun:latest<% | ||
} else if (runtime === 'node') { | ||
%>FROM node:latest<% | ||
} else if (runtime === 'deno') { | ||
%>FROM denoland/deno:alpine<% | ||
} %> | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
|
||
<% if (packageManager === 'bun') { | ||
%>RUN bun install<% | ||
} else if (packageManager === 'npm') { | ||
%>RUN npm install | ||
<% if (client === 'sqlite3' && runtime === 'node') { %> | ||
RUN npm rebuild sqlite3<% | ||
} %><% | ||
} else if (packageManager === 'yarn') { | ||
%>RUN yarn install | ||
<% if (client === 'sqlite3' && runtime === 'node') { %> | ||
RUN yarn rebuild sqlite3<% | ||
} %><% | ||
} else if (packageManager === 'pnpm') { | ||
%>RUN pnpm install | ||
<% if (client === 'sqlite3' && runtime === 'node') { %> | ||
RUN pnpm rebuild sqlite3<% | ||
} %><% | ||
} else if (packageManager === 'deno') { | ||
%>RUN deno install --global --allow-read --allow-write --allow-net --allow-env --allow-run<% | ||
} %> | ||
|
||
COPY . . | ||
|
||
<% if (runtime === 'bun') { | ||
%>CMD ["bun", "run", "start"]<% | ||
} else if (runtime === 'node') { | ||
%>RUN npm build | ||
CMD ["node", "dist/index.js"]<% | ||
} else if (runtime === 'deno') { | ||
%>CMD ["deno", "run", "--allow-read", "--allow-write", "--allow-net", "--allow-env", "--allow-run", "src/index.ts"]<% | ||
} %> |