Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
9850c131
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9850c131
编写于
10月 27, 2015
作者:
M
Mateusz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #26 from kubernetes/gulp-deploy
Gulp tasks for creating Docker deployment images
上级
c1f748f3
218f0f82
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
87 addition
and
1 deletion
+87
-1
build/backend.js
build/backend.js
+1
-1
build/conf.js
build/conf.js
+10
-0
build/deploy.js
build/deploy.js
+75
-0
gulpfile.babel.js
gulpfile.babel.js
+1
-0
未找到文件。
build/backend.js
浏览文件 @
9850c131
...
...
@@ -44,7 +44,7 @@ const goBackendDependencies = [
* default ones.
*/
function
spawnGoProcess
(
args
,
doneFn
,
opt_env
)
{
var
goTask
=
child
.
spawn
(
'
go
'
,
args
,
{
let
goTask
=
child
.
spawn
(
'
go
'
,
args
,
{
env
:
lodash
.
merge
(
process
.
env
,
{
GOPATH
:
conf
.
paths
.
backendTmp
},
opt_env
||
{}),
});
...
...
build/conf.js
浏览文件 @
9850c131
...
...
@@ -28,6 +28,16 @@ const basePath = path.join(__dirname, '../');
* Exported configuration object with common constants used in build pipeline.
*/
export
default
{
/**
* Deployment constants configuration.
*/
deploy
:
{
/**
* The name of the Docker image with the application.
*/
imageName
:
'
kubernetes/console
'
,
},
/**
* Frontend application constants.
*/
...
...
build/deploy.js
0 → 100644
浏览文件 @
9850c131
// Copyright 2015 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview Gulp tasks for deploying and releasing the application.
*/
import
child
from
'
child_process
'
;
import
gulp
from
'
gulp
'
;
import
path
from
'
path
'
;
import
conf
from
'
./conf
'
;
/**
* @param {!Array<string>} args
* @param {function(?Error=)} doneFn
*/
function
spawnDockerProcess
(
args
,
doneFn
)
{
let
dockerTask
=
child
.
spawn
(
'
docker
'
,
args
);
// Call Gulp callback on task exit. This has to be done to make Gulp dependency management
// work.
dockerTask
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
code
===
0
)
{
doneFn
();
}
else
{
doneFn
(
new
Error
(
'
Docker command error, code:
'
+
code
));
}
});
dockerTask
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
console
.
log
(
''
+
data
);
});
dockerTask
.
stderr
.
on
(
'
data
'
,
function
(
data
)
{
console
.
error
(
''
+
data
);
});
}
/**
* Creates Docker image for the application. The image is tagged with the image name configuration
* constant.
*
* In order to run the image on a Kubernates cluster, it has to be deployed to a registry.
*/
gulp
.
task
(
'
docker-image
'
,
[
'
docker-file
'
],
function
(
doneFn
)
{
spawnDockerProcess
([
'
build
'
,
// Remove intermediate containers after a successful build.
'
--rm=true
'
,
'
--tag
'
,
conf
.
deploy
.
imageName
,
conf
.
paths
.
dist
,
],
doneFn
);
});
/**
* Processes the Docker file and places it in the dist folder for building.
*/
gulp
.
task
(
'
docker-file
'
,
function
()
{
return
gulp
.
src
(
path
.
join
(
conf
.
paths
.
deploySrc
,
'
Dockerfile
'
))
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
dist
));
});
gulpfile.babel.js
浏览文件 @
9850c131
...
...
@@ -20,6 +20,7 @@
*/
import
'
./build/backend
'
;
import
'
./build/build
'
;
import
'
./build/deploy
'
;
import
'
./build/index
'
;
import
'
./build/script
'
;
import
'
./build/serve
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录