This repository was archived by the owner on Aug 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
add files for code and learn at COSCon 2019 #99
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
FROM ubuntu:bionic | ||
|
||
# Install tools | ||
RUN apt-get update | ||
RUN apt-get install -y build-essential python ninja-build vim git sudo | ||
|
||
# Expose ports used by net tests | ||
ENV NODE_COMMON_PORT=12346 | ||
EXPOSE 12346 | ||
# debug port used by v8 debugger | ||
EXPOSE 5858 | ||
# debug port used by v8 insepctor | ||
EXPOSE 9229 | ||
|
||
# Set up user node-dev: the tests fail when run by the root | ||
RUN adduser --disabled-password --gecos '' node-dev | ||
RUN adduser node-dev sudo | ||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
USER node-dev | ||
WORKDIR /home/node-dev | ||
ENV HOME /home/node-dev | ||
|
||
# Clone the code and build | ||
RUN git clone --depth=1 https://github.com/nodejs/node.git | ||
WORKDIR /home/node-dev/node | ||
RUN python2 ./configure --ninja | ||
ENV BUILD_WITH ninja | ||
RUN make -j2 test |
This file contains hidden or 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,5 @@ | ||
# Node.js Code + Learn @ COSCon 2019 | ||
|
||
- [事前准备 (praparation)](./preparation.md) | ||
- [Dockerfile](./Dockerfile) | ||
joyeecheung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- [Slides](https://docs.google.com/presentation/d/1NluODLOelMFyui10jSLY8T4M0F444LaG7Ir5u_tfOGM/edit?usp=sharing) |
This file contains hidden or 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,53 @@ | ||
# 事前准备 | ||
|
||
## 安装环境 | ||
|
||
### MacOS | ||
|
||
1. 从 App Store 安装 Xcode | ||
2. 从命令行运行 | ||
|
||
``` | ||
xcode-select --install | ||
``` | ||
3. 推荐安装 ninja。如使用 homebrew: | ||
|
||
``` | ||
brew install ninja | ||
``` | ||
|
||
### Ubuntu | ||
|
||
``` | ||
apt-get update | ||
apt-get install -y build-essential python ninja-build make g++ | ||
``` | ||
|
||
### 其他环境 | ||
|
||
UNIX: https://github.com/nodejs/node/blob/master/BUILDING.md#unix-prerequisites | ||
Windows: https://github.com/nodejs/node/blob/master/BUILDING.md#prerequisites | ||
|
||
## 构建与测试 | ||
|
||
全部环境:推荐先 clone Node.js core 的代码。因为体积较大,建议用 `--depth=1`: | ||
|
||
``` | ||
git clone --depth=1 https://github.com/nodejs/node.git | ||
``` | ||
|
||
推荐在参加前先编译(需耗时半个小时到一个小时)和运行一遍测试(会从 npm 下载一些渲染 API 文档需要的包)。MacOS 和 Linux: | ||
|
||
``` | ||
cd node | ||
|
||
# 如果有安装 ninja | ||
python2 ./configure --ninja | ||
BUILD_WITH=ninja make -j2 test | ||
|
||
# 如果没有安装 ninja | ||
python2 ./configure | ||
make -j2 test | ||
``` | ||
|
||
其中 -j2 的 2 可以替换成机器上的 CPU 逻辑核心数。 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.