-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #943 from tsg-ut/devcontainer2
devcontainerおよびCodespacesの設定を追加
- Loading branch information
Showing
17 changed files
with
232 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
HTTP_PROXY_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
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,27 @@ | ||
services: | ||
slackbot: | ||
build: slackbot | ||
volumes: | ||
- ..:/code | ||
- /code/node_modules | ||
- /code/functions/node_modules | ||
stdin_open: true | ||
tty: true | ||
command: sleep infinity | ||
environment: | ||
- TEAM_ID=${TEAM_ID} | ||
- SIGNING_SECRET=${SIGNING_SECRET} | ||
- SLACK_TOKEN=${SLACK_TOKEN} | ||
- HAKATASHI_TOKEN=${HAKATASHI_TOKEN} | ||
- CHANNEL_SANDBOX=${CHANNEL_SANDBOX} | ||
- SLACK_VERIFICATION_TOKEN=${SLACK_VERIFICATION_TOKEN} | ||
|
||
tunnel: | ||
build: | ||
context: tunnel | ||
dockerfile: Dockerfile | ||
args: | ||
- HTTP_PROXY_TOKEN=${HTTP_PROXY_TOKEN} | ||
stdin_open: true | ||
tty: true | ||
command: node index.mjs --remote wss://slackbot-api.tsg.ne.jp/wsfwd --host slackbot |
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,44 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node | ||
{ | ||
"name": "Node.js", | ||
"dockerComposeFile": "compose.yaml", | ||
"service": "slackbot", | ||
"workspaceFolder": "/code", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": { | ||
"version": "latest" | ||
}, | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": "true", | ||
"username": "slackbot", | ||
"upgradePackages": "true" | ||
} | ||
}, | ||
"runServices": [ | ||
"slackbot", | ||
"tunnel" | ||
], | ||
"postAttachCommand": "docker logs slackbot_devcontainer-tunnel-1 && docker attach slackbot_devcontainer-tunnel-1", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"files.autoSave": "off", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "always", | ||
"source.fixAll.eslint": "always" | ||
}, | ||
"eslint.format.enable": true | ||
}, | ||
"extensions": [ | ||
"ms-vscode.vscode-typescript-next", | ||
"dbaeumer.vscode-eslint", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
"GitHub.vscode-pull-request-github", | ||
"toba.vsfire" | ||
] | ||
} | ||
} | ||
} |
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,16 @@ | ||
FROM node:20-bookworm | ||
|
||
# Install build dependencies for node-canvas | ||
# https://github.com/Automattic/node-canvas/wiki/Installation%3A-Ubuntu-and-other-Debian-based-systems | ||
RUN apt-get update -y && \ | ||
apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y && \ | ||
apt-get install git bash -y && \ | ||
mkdir -p ~/.cache/slackbot/node_modules && \ | ||
mkdir -p ~/.cache/slackbot-functions/node_modules && \ | ||
git clone https://github.com/tsg-ut/slackbot.git --branch master --single-branch --recursive --depth 1 /code && \ | ||
cd /code && \ | ||
npm install && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /code |
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,10 @@ | ||
FROM node:20-bookworm | ||
ARG HTTP_PROXY_TOKEN | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install git bash -y && \ | ||
git clone https://${HTTP_PROXY_TOKEN}@github.com/tsg-ut/http-local-fwd.git && \ | ||
cd http-local-fwd/local && \ | ||
npm install | ||
|
||
WORKDIR /http-local-fwd/local |
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 |
---|---|---|
|
@@ -71,3 +71,4 @@ tokens.sqlite3 | |
.DS_Store | ||
|
||
.vscode | ||
!.vscode/launch.json |
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,56 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Slackbot起動", | ||
"type": "node", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": [ | ||
"run-script", | ||
"dev", | ||
"--", | ||
"--only", | ||
"${input:onlyArgument}" | ||
], | ||
"request": "launch", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"console": "internalConsole", | ||
"outputCapture": "std" | ||
}, | ||
{ | ||
"name": "ユニットテストの実行", | ||
"type": "node", | ||
"runtimeExecutable": "npm", | ||
"args": [ | ||
"run-script", | ||
"test", | ||
"--", | ||
"--colors", | ||
"${input:testFilterArgument}" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"request": "launch", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"console": "internalConsole", | ||
"outputCapture": "std" | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "onlyArgument", | ||
"type": "promptString", | ||
"description": "起動するBOTの種類", | ||
"default": "helloworld" | ||
}, | ||
{ | ||
"id": "testFilterArgument", | ||
"type": "promptString", | ||
"description": "実行するユニットテストの正規表現フィルタ (全部実行する場合は空文字列を入力)", | ||
"default": "" | ||
} | ||
] | ||
} |
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 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 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
Oops, something went wrong.