Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
go-atomci
atomci
提交
8e4aab23
atomci
项目概览
go-atomci
/
atomci
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
atomci
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8e4aab23
编写于
12月 16, 2021
作者:
C
colynn.liu
提交者:
GitHub
12月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15 from go-atomci/feat-add-dckerfile-defined
feat: add app dockerfile path defined
上级
41cf2baa
4670de28
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
33 addition
and
4 deletion
+33
-4
core/pipelinemgr/uitls.go
core/pipelinemgr/uitls.go
+5
-1
core/projects/app.go
core/projects/app.go
+11
-0
core/projects/types.go
core/projects/types.go
+2
-0
models/project.go
models/project.go
+1
-0
web/src/views/project/detail/ProjectAppAdd.vue
web/src/views/project/detail/ProjectAppAdd.vue
+6
-0
web/src/views/project/detail/ProjectAppDetail.vue
web/src/views/project/detail/ProjectAppDetail.vue
+2
-2
web/src/views/project/dialog/ProjectAppEdit.vue
web/src/views/project/dialog/ProjectAppEdit.vue
+6
-1
未找到文件。
core/pipelinemgr/uitls.go
浏览文件 @
8e4aab23
...
...
@@ -1097,7 +1097,11 @@ func (pm *PipelineManager) renderAppImageitemsForBuild(projectID, publishID, sta
}
imageURL
:=
newImageAddr
Command
:=
fmt
.
Sprintf
(
"sh
\"
cd %v; export DOCKER_CONFIG=$DOCKER_CONFIG; /kaniko/executor -f Dockerfile -c ./ -d %v --insecure --skip-tls-verify --insecure-pull
\"
"
,
appPath
,
imageURL
)
dockerfile
:=
app
.
Dockerfile
if
dockerfile
==
""
{
dockerfile
=
"Dockerfile"
}
Command
:=
fmt
.
Sprintf
(
"sh
\"
cd %v; export DOCKER_CONFIG=$DOCKER_CONFIG; /kaniko/executor -f %v -c ./ -d %v --insecure --skip-tls-verify --insecure-pull
\"
"
,
appPath
,
dockerfile
,
imageURL
)
item
.
Command
=
Command
appImageItems
=
append
(
appImageItems
,
item
)
}
...
...
core/projects/app.go
浏览文件 @
8e4aab23
...
...
@@ -32,6 +32,10 @@ func (pm *ProjectManager) CreateProjectApp(projectID int64, item *ProjectAppReq,
// reset default value is master
item
.
BranchName
=
"master"
}
if
item
.
Dockerfile
==
""
{
item
.
Dockerfile
=
"Dockerfile"
}
projectAppModel
:=
models
.
ProjectApp
{
Addons
:
models
.
NewAddons
(),
Creator
:
creator
,
...
...
@@ -44,6 +48,7 @@ func (pm *ProjectManager) CreateProjectApp(projectID int64, item *ProjectAppReq,
Path
:
item
.
Path
,
RepoID
:
item
.
RepoID
,
BuildPath
:
item
.
BuildPath
,
Dockerfile
:
item
.
Dockerfile
,
}
_
,
err
:=
pm
.
model
.
CreateProjectAppIfNotExist
(
&
projectAppModel
)
...
...
@@ -129,6 +134,12 @@ func (pm *ProjectManager) UpdateProjectApp(projectID, projectAppID int64, req *P
projectApp
.
BuildPath
=
req
.
BuildPath
}
if
req
.
Dockerfile
==
""
{
projectApp
.
Dockerfile
=
"Dockerfile"
}
else
{
projectApp
.
Dockerfile
=
req
.
Dockerfile
}
projectApp
.
BranchName
=
req
.
BranchName
projectApp
.
CompileEnvID
=
req
.
CompileEnvID
projectApp
.
Language
=
req
.
Language
...
...
core/projects/types.go
浏览文件 @
8e4aab23
...
...
@@ -41,6 +41,7 @@ type ProjectAppUpdateReq struct {
Path
string
`json:"path"`
CompileEnvID
int64
`json:"compile_env_id"`
BuildPath
string
`json:"build_path"`
Dockerfile
string
`json:"dockerfile"`
}
// ProjectAppBranchUpdateReq ..
...
...
@@ -82,6 +83,7 @@ type ProjectAppReq struct {
FullName
string
`json:"full_name"`
BranchName
string
`json:"branch_name"`
BuildPath
string
`json:"build_path"`
Dockerfile
string
`json:"dockerfile"`
}
// ProjectAppRsp ..
...
...
models/project.go
浏览文件 @
8e4aab23
...
...
@@ -116,6 +116,7 @@ type ProjectApp struct {
RepoID
int64
`orm:"column(repo_id)" json:"repo_id"`
CompileEnvID
int64
`orm:"column(compile_env_id);size(64)" json:"compile_env_id"`
BuildPath
string
`orm:"column(build_path);size(64)" json:"build_path"`
Dockerfile
string
`orm:"column(dockerfile);size(256)" json:"dockerfile"`
BranchHistoryList
[]
string
`orm:"-" json:"branch_history_list"`
}
...
...
web/src/views/project/detail/ProjectAppAdd.vue
浏览文件 @
8e4aab23
...
...
@@ -24,6 +24,10 @@
<el-input
v-model=
"form.build_path"
placeholder=
"请输入构建目录"
style=
"width: 300px"
></el-input>
</el-form-item>
<el-form-item
label=
"Dockerfile"
prop=
"dockerfile"
>
<el-input
v-model=
"form.dockerfile"
placeholder=
"请输入dockerfile,默认是Dockerfile"
style=
"width: 300px"
></el-input>
</el-form-item>
<el-form-item
label=
"编译环境"
prop=
"compile_env_id"
>
<el-select
v-model=
"form.compile_env_id"
placeholder=
"请选择编译环境"
clearable
filterable
style=
"width: 300px"
>
<el-option
v-for=
"(item, index) in compileEnvs"
:key=
"index"
:label=
"item.name"
:value=
"item.id"
>
...
...
@@ -188,6 +192,7 @@
type
:
'
app
'
,
language
:
'
Java
'
,
build_path
:
'
/
'
,
dockerfile
:
'
Dockerfile
'
},
getRepoLoading
:
true
,
rules
:
{
...
...
@@ -297,6 +302,7 @@
cl
.
language
=
this
.
form
.
language
;
cl
.
type
=
'
app
'
;
cl
.
build_path
=
this
.
form
.
build_path
;
cl
.
dockerfile
=
this
.
form
.
dockerfile
||
'
Dockerfile
'
;
cl
.
compile_env_id
=
this
.
form
.
compile_env_id
||
0
;
if
(
this
.
form
.
name
!==
''
)
{
cl
.
name
=
this
.
form
.
name
...
...
web/src/views/project/detail/ProjectAppDetail.vue
浏览文件 @
8e4aab23
...
...
@@ -12,11 +12,11 @@
</el-row>
<el-row
class=
"mt-15"
>
<el-col
class=
"w-400"
>
开发语言:
{{
detailInfo
.
language
}}
</el-col>
<el-col
class=
"w-400"
>
默认分支:
{{
detailInfo
.
branch_name
}}
</el-col>
<el-col
class=
"w-400"
>
编译环境:
{{
detailInfo
.
compile_env
!=
''
?
detailInfo
.
compile_env
:
'
未配置
'
}}
</el-col>
</el-row>
<el-row
class=
"mt-15"
>
<el-col
class=
"w-400"
>
编译环境:
{{
detailInfo
.
compile_env
!=
''
?
detailInfo
.
compile_env
:
'
未配置
'
}}
</el-col>
<el-col
class=
"w-400"
>
构建目录:
{{
detailInfo
.
build_path
}}
</el-col>
<el-col
class=
"w-400"
>
Dockerfile:
{{
detailInfo
.
dockerfile
!=
''
?
detailInfo
.
dockerfile
:
'
Dockerfile
'
}}
</el-col>
</el-row>
<el-row
class=
"mt-15"
>
<el-col
class=
"w-400"
>
创建人:
{{
detailInfo
.
creator
}}
</el-col>
...
...
web/src/views/project/dialog/ProjectAppEdit.vue
浏览文件 @
8e4aab23
...
...
@@ -28,6 +28,9 @@
<el-form-item
label=
"构建目录"
prop=
"build_path"
>
<el-input
v-model=
"form.build_path"
placeholder=
"请输入构建目录"
></el-input>
</el-form-item>
<el-form-item
label=
"Dockerfile"
prop=
"dockerfile"
>
<el-input
v-model=
"form.dockerfile"
placeholder=
"请输入Dockerfile,默认是根目录下的Dockerfile"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"doCancelCreate"
>
{{
$t
(
'
bm.other.cancel
'
)
}}
</el-button>
...
...
@@ -115,6 +118,7 @@ export default {
compile_env_id
:
item
.
compile_env_id
||
0
,
branch_name
:
item
.
branch_name
||
''
,
build_path
:
item
.
build_path
||
'
/
'
,
dockerfile
:
item
.
dockerfile
||
'
Dockerfile
'
,
branchList
:
item
.
branch_history_list
||
[]
};
this
.
rowId
=
item
.
id
;
...
...
@@ -135,7 +139,8 @@ export default {
language
:
this
.
form
.
language
,
path
:
this
.
form
.
path
,
branch_name
:
this
.
form
.
branch_name
,
build_path
:
this
.
form
.
build_path
build_path
:
this
.
form
.
build_path
,
dockerfile
:
this
.
form
.
dockerfile
||
'
Dockerfile
'
,
};
backend
.
updateAppInfo
(
this
.
$route
.
params
.
projectId
,
this
.
rowId
,
cl
,
(
data
)
=>
{
successCallBack
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录