Compare commits
No commits in common. "main" and "v3.6.1-dev1" have entirely different histories.
main
...
v3.6.1-dev
@ -34,13 +34,13 @@ jobs:
|
|||||||
- name: Build the Docker image
|
- name: Build the Docker image
|
||||||
run: |
|
run: |
|
||||||
cd /var/lib/act_runner/nodbot
|
cd /var/lib/act_runner/nodbot
|
||||||
docker build --target dev . --file Dockerfile --tag v0idf1sh/nodbot:dev
|
docker build . --file Dockerfile --tag v0idf1sh/nodbot-dev
|
||||||
- name: Log into Docker Hub
|
- name: Log into Docker Hub
|
||||||
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
|
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
|
||||||
- name: Push image to Docker Hub
|
- name: Push image to Docker Hub
|
||||||
run: |
|
run: |
|
||||||
cd /var/lib/act_runner/nodbot
|
cd /var/lib/act_runner/nodbot
|
||||||
docker push v0idf1sh/nodbot:dev
|
docker push v0idf1sh/nodbot-dev
|
||||||
- name: Restart the container
|
- name: Restart the container
|
||||||
run: |
|
run: |
|
||||||
cd /srv/docker/nodbot-dev
|
cd /srv/docker/nodbot-dev
|
||||||
|
|||||||
@ -33,13 +33,13 @@ jobs:
|
|||||||
- name: Build the Docker image
|
- name: Build the Docker image
|
||||||
run: |
|
run: |
|
||||||
cd /var/lib/act_runner/nodbot
|
cd /var/lib/act_runner/nodbot
|
||||||
docker build --target prod . --file Dockerfile --tag v0idf1sh/nodbot:prod
|
docker build . --file Dockerfile --tag v0idf1sh/nodbot
|
||||||
- name: Log into Docker Hub
|
- name: Log into Docker Hub
|
||||||
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
|
run: docker login -u $DHUB_UNAME -p $DHUB_PWORD
|
||||||
- name: Push image to Docker Hub
|
- name: Push image to Docker Hub
|
||||||
run: |
|
run: |
|
||||||
cd /var/lib/act_runner/nodbot
|
cd /var/lib/act_runner/nodbot
|
||||||
docker push v0idf1sh/nodbot:prod
|
docker push v0idf1sh/nodbot
|
||||||
- name: Restart the container
|
- name: Restart the container
|
||||||
run: |
|
run: |
|
||||||
cd /srv/docker/nodbot
|
cd /srv/docker/nodbot
|
||||||
|
|||||||
13
Dockerfile
13
Dockerfile
@ -1,15 +1,4 @@
|
|||||||
# Dev Build
|
FROM node:18
|
||||||
FROM node:18 AS dev
|
|
||||||
RUN mkdir -p /usr/src/app
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
COPY package.json ./
|
|
||||||
RUN npm install
|
|
||||||
COPY . .
|
|
||||||
# Invoke the bot without redirecting STDOUT and STDERR so that docker logs can be used.
|
|
||||||
CMD ["/bin/sh", "-c", "node main.js"]
|
|
||||||
|
|
||||||
FROM node:18 AS prod
|
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ module.exports = {
|
|||||||
try {
|
try {
|
||||||
fn.upload.request(requester, requestText, messageUrl, message.client);
|
fn.upload.request(requester, requestText, messageUrl, message.client);
|
||||||
// Set the content to sent a text embed notifying the user of success
|
// Set the content to sent a text embed notifying the user of success
|
||||||
commandData.content = `Your request has been submitted!\nRequest: ${requestText}`;
|
commandData.content = `Your request has been submitted!\nRequest: ${request}`;
|
||||||
const replyEmbed = fn.embeds.text(commandData);
|
const replyEmbed = fn.embeds.text(commandData);
|
||||||
message.reply({ embeds: [ replyEmbed ]});
|
message.reply({ embeds: [ replyEmbed ]});
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
@ -22,8 +22,8 @@ module.exports = {
|
|||||||
const replyEmbed = fn.embeds.text(commandData);
|
const replyEmbed = fn.embeds.text(commandData);
|
||||||
message.reply({ embeds: [ replyEmbed ]});
|
message.reply({ embeds: [ replyEmbed ]});
|
||||||
|
|
||||||
const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${err}`);
|
const errorEmbed = fn.embeds.error(`An error has occurred in command ${this.name}:\n${JSON.stringify(err)}`);
|
||||||
fn.sendAlert(errorEmbed, message.client);
|
fn.sendAlert(errorEmbed);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -465,7 +465,7 @@ const functions = {
|
|||||||
error(errorText) {
|
error(errorText) {
|
||||||
const errorEmbed = new Discord.MessageEmbed()
|
const errorEmbed = new Discord.MessageEmbed()
|
||||||
.setAuthor({ name: "Error!" })
|
.setAuthor({ name: "Error!" })
|
||||||
.setDescription(errorText)
|
.setDescription({ text: errorText })
|
||||||
.setFooter({ text: appVersion });
|
.setFooter({ text: appVersion });
|
||||||
|
|
||||||
return errorEmbed;
|
return errorEmbed;
|
||||||
@ -921,7 +921,7 @@ const functions = {
|
|||||||
const errorId = digits.join("");
|
const errorId = digits.join("");
|
||||||
return errorId;
|
return errorId;
|
||||||
},
|
},
|
||||||
async sendAlert(embed, client) {
|
async sendAlert(embed) {
|
||||||
const statusChannel = await client.channels.fetch(statusChannelId)
|
const statusChannel = await client.channels.fetch(statusChannelId)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user