From f8d029431f7545b134356480432a4ff1578f170e Mon Sep 17 00:00:00 2001 From: Lukas | AstroGD Date: Thu, 24 Nov 2022 21:25:41 +0100 Subject: [PATCH] Beta release --- README.md | 18 ++++++++++-------- ci/deploy.ts | 4 ++-- package-lock.json | 4 ++-- package.json | 3 ++- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cc5822f..196842c 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,16 @@ Removes the word from the server specific blocklist Returns general information about the bot and the servers stats ## Environment variables -| Name | Description | Required | Example | -| :---------- | :------------------------------------------------------------ | :------: | :------------------ | -| TOKEN | Discord bot token to log into the API with | ▶️/🚀 | NzYzMDP3MzE1Mzky... | -| DB_HOST | Hostname of the database | ▶️ | 127.0.0.1:3546 | -| DB_USERNAME | Username of the database | ▶️ | root | -| DB_PASSWORD | Password of the database | ▶️ | abc123 | -| DB_DATABASE | Database name | ▶️ | white-leopard | -| CLIENT_ID | Client ID of the Discord appication associated with the token | 🚀 | 763035392692274 | +| Name | Description | Required | Example | +| :--------------- | :------------------------------------------------------------------------------ | :------: | :------------------ | +| TOKEN | Discord bot token to log into the API with | ▶️/🚀 | NzYzMDP3MzE1Mzky... | +| DB_HOST | Hostname of the database | ▶️ | 127.0.0.1:3546 | +| DB_USERNAME | Username of the database | ▶️ | root | +| DB_PASSWORD | Password of the database | ▶️ | abc123 | +| DB_DATABASE | Database name | ▶️ | white-leopard | +| CLIENT_ID | Client ID of the Discord appication associated with the token | 🚀 | 763035392692274 | +| DEPLOY_TOKEN | Production Discord bot token to log into the API with | 🚀 | NzYzMDP3MzE1Mzky... | +| DEPLOY_CLIENT_ID | Production Client ID of the Discord appication associated with the deploy token | 🚀 | 763035392692274 | ### Icon explanation: - ▶️ = Required in runtime diff --git a/ci/deploy.ts b/ci/deploy.ts index f454013..9ece94b 100644 --- a/ci/deploy.ts +++ b/ci/deploy.ts @@ -4,8 +4,8 @@ import dotenv from "dotenv"; dotenv.config({ path: path.join(__dirname, "../.env") }); // Environment checking -const TOKEN = process.env["TOKEN"]; -const CLIENT_ID = process.env["CLIENT_ID"]; +const TOKEN = process.env["DEPLOY_TOKEN"]; +const CLIENT_ID = process.env["DEPLOY_CLIENT_ID"]; if (!TOKEN) throw new ReferenceError("Environment variable TOKEN is missing"); if (!CLIENT_ID) throw new ReferenceError("Environment variable CLIENT_ID is missing"); diff --git a/package-lock.json b/package-lock.json index 8bad6c4..2911260 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eu.astrogd.white-leopard", - "version": "1.0.0-alpha.5", + "version": "1.0.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eu.astrogd.white-leopard", - "version": "1.0.0-alpha.5", + "version": "1.0.0-beta.1", "license": "CC-BY-NC-ND-4.0", "dependencies": { "discord.js": "^14.6.0", diff --git a/package.json b/package.json index f5b1047..db42af3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eu.astrogd.white-leopard", - "version": "1.0.0-alpha.5", + "version": "1.0.0-beta.1", "description": "A Discord bot that checks channel names for blacklisted words and reverts the changes if necessary", "main": "build/index.js", "scripts": { @@ -9,6 +9,7 @@ "deploy-commands:dev": "ts-node ci/devDeploy.ts", "deploy-commands:prod": "ts-node ci/deploy.ts", "deploy:dev": "npm run build && npm run deploy-commands:dev && docker compose build && docker compose up -d", + "deploy:prod": "rimraf build && npm run build && npm run deploy-commands:prod && docker build -t astrogd/white-leopard:latest . && docker push astrogd/white-leopard:latest", "start": "npm run build && npm run deploy-commands:dev && docker-compose up --no-start && docker compose start database && node --enable-source-maps .", "migration:create": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate -d src/data/dataSource.ts -p src/data/migrations/data", "migration:run": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:run -d src/data/dataSource.ts",