-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Change-Code-Gen-to-Sqlite-Base
- Loading branch information
Showing
17 changed files
with
145 additions
and
74 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
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,19 @@ | ||
name: "docker-cd" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# - name: Build Docker Image | ||
# run: | | ||
# docker build . -t ci:0 | ||
|
||
# - name: Deploy Docker | ||
# run: | | ||
# docker compose pull |
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,15 @@ | ||
name: "docker-ci" | ||
|
||
on: | ||
push: {} | ||
pull_request: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build Docker Image | ||
run: | | ||
docker build . -t ci:0 |
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 |
---|---|---|
|
@@ -35,3 +35,4 @@ __* | |
|
||
# Whitelisted Files | ||
!start_bot.bat | ||
!update.bat |
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 |
---|---|---|
@@ -1 +1 @@ | ||
npm test | ||
npm run lint |
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
# Inertia Lighting Discord Bot | ||
|
||
[![CodeQL](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/codeql-analysis.yml) | ||
|
||
## About | ||
|
||
This code was made for Inertia Lighting. | ||
|
||
Any attempt to use it without explicit permission is prohibited. | ||
|
||
Assume that all works contained in this repository are copyrighted and protected under law. | ||
|
||
## Copyright | ||
|
||
Copyright © Inertia Lighting, Some Rights Reserved | ||
# Inertia Lighting Discord Bot | ||
|
||
[![CodeQL](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/codeql-analysis.yml) | ||
[![ESLint](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/eslint.yml/badge.svg)](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/eslint.yml) | ||
[![docker-ci](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/docker-ci.yml/badge.svg)](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/docker-ci.yml) | ||
[![docker-cd](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/docker-cd.yml/badge.svg)](https://github.com/Inertia-Lighting/discord-bot/actions/workflows/docker-cd.yml) | ||
|
||
## About | ||
|
||
This code was made for Inertia Lighting. | ||
|
||
Any attempt to use it without explicit permission is prohibited. | ||
|
||
Assume that all works contained in this repository are copyrighted and protected under law. | ||
|
||
## Copyright | ||
|
||
Copyright © Inertia Lighting, Some Rights Reserved |
Empty file.
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,6 @@ | ||
|
||
services: | ||
discord-bot: | ||
image: 'intertia-discord-bot' | ||
env_file: | ||
- ./.env |
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,19 @@ | ||
FROM node:lts-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy source code | ||
COPY . /usr/src/app/ | ||
|
||
# Install dependencies | ||
RUN npm ci --immutable | ||
|
||
# Build the bot | ||
RUN npm run build | ||
|
||
# Create tmp directory | ||
RUN mkdir -p /usr/src/app/temporary | ||
|
||
# Start the bot | ||
CMD ["npm", "start"] |
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 @@ | ||
export * from '.'; |
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,13 @@ | ||
import { DbUserData, DbUserDataArray } from '@root/types'; | ||
|
||
export async function dbUserArray( | ||
db_user_data: DbUserData | ||
): Promise<DbUserDataArray> { | ||
const product_array: string[] = Object.keys(db_user_data.products).filter(product => db_user_data.products[product]); | ||
return { | ||
_id: db_user_data._id, | ||
identity: db_user_data.identity, | ||
lumens: db_user_data.lumens, | ||
products: product_array, | ||
}; | ||
} |
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 was deleted.
Oops, something went wrong.
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,8 @@ | ||
if [[ `git status --porcelain` ]]; then | ||
call git pull | ||
call docker build --tag inertia-dicord-bot . | ||
call docker-compose doown | ||
call docker-compose up -d | ||
else | ||
# No changes | ||
fi |