Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
2fdf09e6
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2fdf09e6
编写于
7月 10, 2019
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Include version when building
上级
09e3cfd8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
31 deletion
+43
-31
README.md
README.md
+5
-2
scripts/ci.bash
scripts/ci.bash
+25
-17
scripts/merge.js
scripts/merge.js
+2
-0
scripts/nbin-loader.js
scripts/nbin-loader.js
+1
-1
scripts/tasks.bash
scripts/tasks.bash
+10
-11
未找到文件。
README.md
浏览文件 @
2fdf09e6
...
...
@@ -56,8 +56,11 @@ How to [secure your setup](/doc/security/ssl.md).
directory which will cause issues because then
`yarn watch`
will try to
compile the build directory as well.
-
For now
`@coder/nbin`
is a global dependency.
-
Run
`yarn build ${vscodeVersion} ${target} ${arch}`
in this directory (for example:
`yarn build 1.35.0 linux x64`
).
-
Run
`yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}`
in
this directory (for example:
`yarn build development 1.35.0 linux x64`
).
-
You can run the built code with
`node path/to/build/out/vs/server/main.js`
or run
`yarn binary`
with the same arguments in the previous step to package the
code into a single binary.
## Development
...
...
scripts/ci.bash
浏览文件 @
2fdf09e6
#!/bin/bash
set
-euo
pipefail
# Build using a Docker container
using the specified image and version
.
# Build using a Docker container.
function
docker-build
()
{
local
image
=
"
${
1
}
"
;
shift
local
version
=
"
${
1
}
"
;
shift
local
vscodeVersion
=
"
${
1
}
"
;
shift
local
target
=
"
${
1
}
"
;
shift
local arch
=
"
${
1
}
"
;
shift
local
containerId
containerId
=
$(
docker create
--network
=
host
--rm
-it
-v
"
$(
pwd
)
"
/.cache:/src/.cache
"
${
image
}
"
)
docker start
"
${
containerId
}
"
docker
exec
"
${
containerId
}
"
mkdir
-p
/src
function
docker-exec
()
{
docker
exec
"
${
containerId
}
"
bash
-c
"
$@
"
local command
=
"
${
1
}
"
;
shift
local
args
=
"'
${
codeServerVersion
}
' '
${
vscodeVersion
}
' '
${
target
}
' '
${
arch
}
'"
docker
exec
"
${
containerId
}
"
\
bash
-c
"cd /src && CI=true yarn
${
command
}
${
args
}
"
}
docker
cp
./.
"
${
containerId
}
"
:/src
docker-exec
"cd /src && CI=true yarn build
\"
${
vscodeVersion
}
\"
\"
${
target
}
\"
\"
${
arch
}
\"
"
docker-exec
"cd /src && CI=true yarn binary
\"
${
vscodeVersion
}
\"
\"
${
target
}
\"
\"
${
arch
}
\"
"
docker-exec
"cd /src && CI=true yarn package
\"
${
vscodeVersion
}
\"
\"
${
target
}
\"
\"
${
arch
}
\"
\"
${
version
}
\"
"
docker-exec
build
docker-exec
binary
docker-exec
package
docker
cp
"
${
containerId
}
"
:/src/release/. ./release/
docker stop
"
${
containerId
}
"
}
# Build locally.
function
local-build
()
{
function
local-exec
()
{
local command
=
"
${
1
}
"
;
shift
CI
=
true
yarn
"
${
command
}
"
\
"
${
codeServerVersion
}
"
"
${
vscodeVersion
}
"
"
${
target
}
"
"
${
arch
}
"
}
local-exec build
local-exec binary
local-exec package
}
# Build code-server in the CI.
function
main
()
{
local
v
ersion
=
"
${
VERSION
:-}
"
local
codeServerV
ersion
=
"
${
VERSION
:-}
"
local
vscodeVersion
=
"
${
VSCODE_VERSION
:-}
"
local
ostype
=
"
${
OSTYPE
:-}
"
local
target
=
"
${
TARGET
:-}
"
local arch
=
x64
if
[[
-z
"
${
v
ersion
}
"
]]
;
then
if
[[
-z
"
${
codeServerV
ersion
}
"
]]
;
then
>
&2
echo
"Must set VERSION environment variable"
;
exit
1
fi
...
...
@@ -45,9 +55,7 @@ function main() {
if
[[
"
${
ostype
}
"
==
"darwin"
*
]]
;
then
target
=
darwin
CI
=
true
yarn build
"
${
vscodeVersion
}
"
"
${
target
}
"
"
${
arch
}
"
CI
=
true
yarn binary
"
${
vscodeVersion
}
"
"
${
target
}
"
"
${
arch
}
"
CI
=
true
yarn package
"
${
vscodeVersion
}
"
"
${
target
}
"
"
${
arch
}
"
"
${
version
}
"
local-build
else
local
image
if
[[
"
${
target
}
"
==
alpine
]]
;
then
...
...
@@ -57,7 +65,7 @@ function main() {
image
=
codercom/nbin-centos
target
=
linux
fi
docker-build
"
${
image
}
"
"
${
version
}
"
"
${
vscodeVersion
}
"
"
${
target
}
"
"
${
arch
}
"
docker-build
fi
}
...
...
scripts/merge.js
浏览文件 @
2fdf09e6
...
...
@@ -3,6 +3,7 @@ const fs = require("fs");
const
a
=
process
.
argv
[
2
];
const
b
=
process
.
argv
[
3
];
const
out
=
process
.
argv
[
4
];
const
json
=
JSON
.
parse
(
process
.
argv
[
5
]
||
"
{}
"
);
const
aJson
=
JSON
.
parse
(
fs
.
readFileSync
(
a
));
const
bJson
=
JSON
.
parse
(
fs
.
readFileSync
(
b
));
...
...
@@ -15,4 +16,5 @@ delete aJson.optionalDependencies;
fs
.
writeFileSync
(
out
,
JSON
.
stringify
({
...
aJson
,
...
bJson
,
...
json
,
},
null
,
2
));
scripts/nbin-loader.js
浏览文件 @
2fdf09e6
...
...
@@ -4,6 +4,6 @@ if (!global.NBIN_LOADED) {
nbin
.
shimNativeFs
(
"
{{ROOT_PATH}}
"
);
global
.
NBIN_LOADED
=
true
;
}
catch
(
error
)
{
console
.
log
(
"
Not in the binary
"
);
// Not in the binary.
}
}
scripts/tasks.bash
浏览文件 @
2fdf09e6
...
...
@@ -72,8 +72,10 @@ function build-code-server() {
rm
-rf
"
${
codeServerBuildPath
}
"
mkdir
-p
"
${
codeServerBuildPath
}
"
local
json
=
"{
\"
codeServerVersion
\"
:
\"
${
codeServerVersion
}
\"
}"
cp
-r
"
${
vscodeBuildPath
}
/resources/app/extensions"
"
${
codeServerBuildPath
}
"
node
"
${
rootPath
}
/scripts/merge.js"
"
${
vscodeBuildPath
}
/resources/app/package.json"
"
${
rootPath
}
/scripts/package.json"
"
${
codeServerBuildPath
}
/package.json"
node
"
${
rootPath
}
/scripts/merge.js"
"
${
vscodeBuildPath
}
/resources/app/package.json"
"
${
rootPath
}
/scripts/package.json"
"
${
codeServerBuildPath
}
/package.json"
"
${
json
}
"
node
"
${
rootPath
}
/scripts/merge.js"
"
${
vscodeBuildPath
}
/resources/app/product.json"
"
${
rootPath
}
/scripts/product.json"
"
${
codeServerBuildPath
}
/product.json"
cp
-r
"
${
vscodeSourcePath
}
/out"
"
${
codeServerBuildPath
}
"
rm
-rf
"
${
codeServerBuildPath
}
/out/vs/server/node_modules"
...
...
@@ -187,12 +189,7 @@ function vstar-task() {
}
function
package-task
()
{
local
version
=
"
${
1
}
"
;
shift
log
" version:
${
version
}
"
local
archiveName
=
"code-server
${
version
}
-vsc
${
vscodeVersion
}
-
${
target
}
-
${
arch
}
"
local
archivePath
=
"
${
releasePath
}
/
${
archiveName
}
"
local
archivePath
=
"
${
releasePath
}
/
${
binaryName
}
"
rm
-rf
"
${
archivePath
}
"
mkdir
-p
"
${
archivePath
}
"
...
...
@@ -203,10 +200,10 @@ function package-task() {
cd
"
${
releasePath
}
"
if
[[
"
${
target
}
"
==
"linux"
]]
;
then
tar
-czf
"
${
archiveName
}
.tar.gz"
"
${
archive
Name
}
"
tar
-czf
"
${
binaryName
}
.tar.gz"
"
${
binary
Name
}
"
log
"Archive:
${
archivePath
}
.tar.gz"
else
zip
-r
"
${
archiveName
}
.zip"
"
${
archive
Name
}
"
zip
-r
"
${
binaryName
}
.zip"
"
${
binary
Name
}
"
log
"Archive:
${
archivePath
}
.zip"
fi
}
...
...
@@ -226,6 +223,7 @@ function binary-task() {
function
main
()
{
local
task
=
"
${
1
}
"
;
shift
local
codeServerVersion
=
"
${
1
}
"
;
shift
local
vscodeVersion
=
"
${
1
}
"
;
shift
local
target
=
"
${
1
}
"
;
shift
local arch
=
"
${
1
}
"
;
shift
...
...
@@ -262,13 +260,14 @@ function main() {
local
vscodeSourcePath
=
"
${
buildPath
}
/
${
vscodeSourceName
}
"
local
vscodeBuildPath
=
"
${
buildPath
}
/
${
vscodeBuildName
}
"
local
codeServerBuildName
=
"code-server
-
${
vscodeVersion
}
-
${
target
}
-
${
arch
}
-built"
local
codeServerBuildName
=
"code-server
${
codeServerVersion
}
-vsc
${
vscodeVersion
}
-
${
target
}
-
${
arch
}
-built"
local
codeServerBuildPath
=
"
${
buildPath
}
/
${
codeServerBuildName
}
"
local
binaryName
=
"code-server
-
${
vscodeVersion
}
-
${
target
}
-
${
arch
}
"
local
binaryName
=
"code-server
${
codeServerVersion
}
-vsc
${
vscodeVersion
}
-
${
target
}
-
${
arch
}
"
log
"Running
${
task
}
task"
log
" rootPath:
${
rootPath
}
"
log
" outPath:
${
outPath
}
"
log
" codeServerVersion:
${
codeServerVersion
}
"
log
" vscodeVersion:
${
vscodeVersion
}
"
log
" target:
${
target
}
"
log
" arch:
${
arch
}
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录