mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
Merge branch 'main' into dependabot/npm_and_yarn/husky-6.0.0
This commit is contained in:
commit
c0166d5e5b
9 changed files with 1240 additions and 1042 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.15-alpine AS builder
|
||||
FROM node:14 AS builder
|
||||
|
||||
# Create the user and group files that will be used in the running container to
|
||||
# run the process as an unprivileged user.
|
||||
|
@ -6,41 +6,23 @@ RUN mkdir /user \
|
|||
&& echo 'nobody:x:65534:65534:nobody:/:' >/user/passwd \
|
||||
&& echo 'nobody:x:65534:' >/user/group
|
||||
|
||||
# Install the Certificate-Authority certificates for the app to be able to make
|
||||
# calls to HTTPS endpoints.
|
||||
# Git is required for fetching the dependencies.
|
||||
RUN apk add --no-cache ca-certificates git
|
||||
|
||||
# Set the working directory outside $GOPATH to enable the support for modules.
|
||||
WORKDIR /src
|
||||
|
||||
# Fetch dependencies first; they are less susceptible to change on every build
|
||||
# and will therefore be cached for speeding up the next build
|
||||
COPY ./go.mod ./go.sum ./
|
||||
RUN go mod download
|
||||
COPY ./package.json ./yarn.lock /src/
|
||||
COPY ./packages/bot/package.json /src/packages/bot/
|
||||
RUN yarn workspace @roleypoly/bot install --focus
|
||||
|
||||
# Import the code from the context.
|
||||
COPY ./ ./
|
||||
FROM node:14-slim AS final
|
||||
WORKDIR /src
|
||||
|
||||
# Build the executable to `/app`. Mark the build as statically linked.
|
||||
RUN CGO_ENABLED=0 go build \
|
||||
-installsuffix "static" \
|
||||
-o /app ./src/discord-bot
|
||||
|
||||
# Final stage: the running container.
|
||||
FROM scratch AS final
|
||||
|
||||
# Import the user and group files from the first stage.
|
||||
COPY --from=builder /user/group /user/passwd /etc/
|
||||
|
||||
# Import the Certificate-Authority certificates for enabling HTTPS.
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
# Import the compiled executable from the first stage.
|
||||
COPY --from=builder /app /app
|
||||
|
||||
# Perform any further action as an unprivileged user.
|
||||
USER nobody:nobody
|
||||
|
||||
# Run the compiled binary.
|
||||
ENTRYPOINT ["/app"]
|
||||
# Import the code from the context.
|
||||
COPY --from=builder /src/node_modules /src/node_modules
|
||||
COPY ./packages/bot /src/packages/bot
|
||||
|
||||
ENTRYPOINT [ "node", "/src/packages/bot/index.js" ]
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"devDependencies": {
|
||||
"@types/enzyme": "^3.10.8",
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.5.0",
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.6",
|
||||
"husky": "^6.0.0",
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
"@roleypoly/worker-emulator": "*",
|
||||
"ksuid": "^2.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-loader": "^8.0.18"
|
||||
"ts-loader": "^8.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,11 @@ function messageEventListener(message) {
|
|||
channel.send(`:beginner: Assign your roles here! ${appUrl}/s/${guildId}`);
|
||||
}
|
||||
|
||||
const client = new Client();
|
||||
const client = new Client({
|
||||
ws: {
|
||||
intents: ['GUILDS', 'GUILD_MESSAGES'],
|
||||
},
|
||||
});
|
||||
|
||||
client.on('message', (message) => messageEventListener(message));
|
||||
client.login(botToken);
|
||||
|
|
|
@ -5,5 +5,8 @@ const { ShardingManager } = require('discord.js');
|
|||
|
||||
const botToken = process.env['BOT_TOKEN'];
|
||||
|
||||
const manager = new ShardingManager('./bot.js', { token: botToken });
|
||||
const manager = new ShardingManager(path.resolve(__dirname, 'bot.js'), {
|
||||
token: botToken,
|
||||
});
|
||||
|
||||
manager.spawn();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"discord.js": "^12.5.1"
|
||||
"discord.js": "^12.5.3",
|
||||
"dotenv": "^8.2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,23 +17,23 @@
|
|||
"react-helmet": "^6.1.0",
|
||||
"react-icons": "^4.2.0",
|
||||
"react-is": "^17.0.2",
|
||||
"react-tooltip": "^4.2.15",
|
||||
"styled-components": "^5.2.1",
|
||||
"react-tooltip": "^4.2.17",
|
||||
"styled-components": "^5.2.3",
|
||||
"styled-normalize": "^8.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@icons/material": "^0.4.1",
|
||||
"@storybook/addon-actions": "^6.1.21",
|
||||
"@storybook/addon-essentials": "^6.1.21",
|
||||
"@storybook/addon-links": "^6.1.21",
|
||||
"@storybook/addons": "^6.1.21",
|
||||
"@storybook/react": "^6.1.21",
|
||||
"@storybook/theming": "^6.1.21",
|
||||
"@storybook/addon-actions": "^6.2.2",
|
||||
"@storybook/addon-essentials": "^6.2.2",
|
||||
"@storybook/addon-links": "^6.2.2",
|
||||
"@storybook/addons": "^6.2.2",
|
||||
"@storybook/react": "^6.2.2",
|
||||
"@storybook/theming": "^6.2.2",
|
||||
"@types/chroma-js": "^2.1.3",
|
||||
"@types/node": "^14.14.35",
|
||||
"@types/node": "^14.14.37",
|
||||
"@types/react": "^17.0.3",
|
||||
"@types/react-custom-scrollbars": "^4.0.7",
|
||||
"@types/react-dom": "^17.0.2",
|
||||
"@types/react-dom": "^17.0.3",
|
||||
"@types/react-helmet": "^6.1.0",
|
||||
"@types/styled-components": "^5.1.9",
|
||||
"babel-loader": "8.1.0",
|
||||
|
|
|
@ -11,14 +11,6 @@
|
|||
"@reach/router": "^1.3.4",
|
||||
"@roleypoly/design-system": "*",
|
||||
"@roleypoly/misc-utils": "*",
|
||||
"@roleypoly/types": "*",
|
||||
"@testing-library/jest-dom": "^5.11.9",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.0.7",
|
||||
"@types/jest": "^26.0.21",
|
||||
"@types/node": "^14.14.35",
|
||||
"@types/react": "^17.0.3",
|
||||
"@types/react-dom": "^17.0.2",
|
||||
"memoize-one": "^5.1.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
|
@ -29,10 +21,18 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@craco/craco": "^6.1.1",
|
||||
"@roleypoly/types": "*",
|
||||
"@testing-library/jest-dom": "^5.11.10",
|
||||
"@testing-library/react": "^11.2.6",
|
||||
"@testing-library/user-event": "^13.1.1",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/node": "^14.14.37",
|
||||
"@types/react": "^17.0.3",
|
||||
"@types/react-dom": "^17.0.3",
|
||||
"@types/react-helmet": "^6.1.0",
|
||||
"babel-loader": "8.1.0",
|
||||
"cross-env": "7.0.3",
|
||||
"ts-loader": "^8.0.18",
|
||||
"ts-loader": "^8.1.0",
|
||||
"webpack": "4.44.2"
|
||||
},
|
||||
"browserslist": {
|
||||
|
|
Loading…
Add table
Reference in a new issue