Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
remove yarn deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasptsch committed Nov 5, 2022
1 parent 7f13028 commit 8d47f70
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV VERSION=$VERSION
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma
COPY --from=build /app/dist dist
RUN yarn install --production --frozen-lockfile
CMD yarn deploy && npx prisma migrate deploy && yarn start
CMD npx prisma migrate deploy && yarn start

# Runner
FROM build as pterodactyl
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There are a few different ways to run this bot:

1. Let me run the bot for you. [Invite Link](https://discord.com/api/oauth2/authorize?client_id=916643283118198804&permissions=8&scope=bot%20applications.commands)

2. Clone the repository and run `yarn`, `yarn prisma migrate deploy`, `yarn build`, `yarn deploy` then `yarn start`. This will store the database files in the `config` directory. To update simply `git pull` then run `yarn prisma migrate deploy` and then `yarn start`.
2. Clone the repository and run `yarn`, `yarn prisma migrate deploy`, `yarn build` then `yarn start`. This will store the database files in the `config` directory. To update simply `git pull` then run `yarn prisma migrate deploy` and then `yarn start`.

3. The docker image. The easiest way to run this bot would be to either clone the repository and then run `docker-compose up -d`.

Expand All @@ -35,4 +35,4 @@ In order to work correctly the bot needs to be able to read the presence of guil

### Slash Commands

To add the slash commands to your own servers run `yarn deploy`.
To add the slash commands to your own servers just run the bot.
2 changes: 1 addition & 1 deletion dynamica-egg.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"features": null,
"images": ["ghcr.io/dynamicabot/dynamica:latest-pterodactyl"],
"file_denylist": [],
"startup": "yarn deploy;\r\nnpx prisma migrate deploy;\r\nyarn start",
"startup": "npx prisma migrate deploy;\r\nyarn start",
"config": {
"files": "{}",
"startup": "{\r\n \"done\": \"Ready! Logged in as\"\r\n}",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"prettier": "prettier --write ./src",
"lint": "eslint --ext .ts",
"generate": "prisma generate",
"deploy": "node dist/deploy-commands.js",
"undeploy": "node dist/remove-commands.js",
"deploy": "echo \"This script is no longer used. All you need to do is run yarn start and deployment happens automatically.\"",
"undeploy": "echo \"If you need to remove commands use mqtt.\"",
"build": "tsup"
},
"devDependencies": {
Expand Down
9 changes: 0 additions & 9 deletions src/deploy-commands.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import registerEvents from './register-events';
import registerHelp from './register-help';
import registerCommands from './register-commands';
import MQTT from './services/MQTT';
import deployCommands from './scripts/deploy';

dotenv.config();

Expand All @@ -20,6 +21,8 @@ registerHelp();
registerEvents();
registerAutocompletes();

await deployCommands();

const events = Container.get(Events);
const client = Container.get(Client);
const logger = Container.get(Logger);
Expand Down
9 changes: 0 additions & 9 deletions src/remove-commands.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { REST } from '@discordjs/rest';
import Logger from '@/services/Logger';
import { Routes } from 'discord-api-types/v10';
import { Container } from 'typedi';
import MQTT from '@/services/MQTT';

const { TOKEN, CLIENT_ID, GUILD_ID } = process.env;
const logger = Container.get(Logger);
Expand All @@ -18,7 +17,6 @@ export default async function deployCommands() {

registerCommands();
const commands = Container.get(Commands);
const mqtt = Container.get(MQTT);
const commandData = commands.data();
// console.log({ commandData });

Expand All @@ -38,6 +36,5 @@ export default async function deployCommands() {
logger.error(error);
}
deployLogger.timeEnd('deploy');
mqtt.stop();
}
}
4 changes: 2 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { defineConfig } from 'tsup';

export default defineConfig(({ watch }) => ({
entry: ['src/index.ts', 'src/deploy-commands.ts', 'src/remove-commands.ts'],
splitting: false,
entry: ['src/index.ts'],
splitting: true,
sourcemap: true,
clean: true,
format: ['esm'],
Expand Down

0 comments on commit 8d47f70

Please sign in to comment.