Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
go-atomci
atomci
提交
bd71a4ab
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,体验更适合开发者的 AI 搜索 >>
提交
bd71a4ab
编写于
7月 03, 2023
作者:
C
colynn.liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
feat(Done): jnlp agent change to native agent
上级
a7ffee68
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
90 addition
and
35 deletion
+90
-35
internal/api/integrate.go
internal/api/integrate.go
+1
-1
internal/core/pipelinemgr/uitls.go
internal/core/pipelinemgr/uitls.go
+1
-1
internal/core/settings/compile_env.go
internal/core/settings/compile_env.go
+2
-2
internal/dao/integrate_settings.go
internal/dao/integrate_settings.go
+2
-4
internal/migrations/migration20220415.go
internal/migrations/migration20220415.go
+27
-27
internal/migrations/migration20230703.go
internal/migrations/migration20230703.go
+56
-0
internal/migrations/migrations.go
internal/migrations/migrations.go
+1
-0
未找到文件。
internal/api/integrate.go
浏览文件 @
bd71a4ab
...
...
@@ -203,7 +203,7 @@ func (p *IntegrateController) DeleteIntegrateSetting() {
// GetCompileEnvs ..
func
(
p
*
IntegrateController
)
GetCompileEnvs
()
{
pm
:=
settings
.
NewSettingManager
()
rsp
,
err
:=
pm
.
GetCompileEnvs
(
""
)
rsp
,
err
:=
pm
.
GetCompileEnvs
()
if
err
!=
nil
{
p
.
HandleInternalServerError
(
err
.
Error
())
log
.
Log
.
Error
(
"Get compile envs occur error: %s"
,
err
.
Error
())
...
...
internal/core/pipelinemgr/uitls.go
浏览文件 @
bd71a4ab
...
...
@@ -1157,7 +1157,7 @@ func (pm *PipelineManager) renderHealthCheckCommand(projectID, stageID, publishJ
}
item
:=
&
jenkins
.
StepItem
{}
item
.
Name
=
app
.
Name
// TODO:
wip split healthcheck
, use checkout container name tmp.
// TODO:
refactor(WIP) healthcheck stage
, use checkout container name tmp.
item
.
ContainerName
=
constant
.
CheckoutContainerName
appArrange
,
err
:=
pm
.
appHandler
.
GetRealArrange
(
app
.
ID
,
stageID
)
...
...
internal/core/settings/compile_env.go
浏览文件 @
bd71a4ab
...
...
@@ -34,8 +34,8 @@ type CompileEnvReq struct {
}
// GetCompileEnvs ..
func
(
pm
*
SettingManager
)
GetCompileEnvs
(
integrateType
string
)
([]
*
models
.
CompileEnv
,
error
)
{
items
,
err
:=
pm
.
model
.
GetCompileEnvs
(
integrateType
)
func
(
pm
*
SettingManager
)
GetCompileEnvs
()
([]
*
models
.
CompileEnv
,
error
)
{
items
,
err
:=
pm
.
model
.
GetCompileEnvs
()
if
err
!=
nil
{
log
.
Log
.
Error
(
"get interate settings error: %s"
,
err
.
Error
())
return
nil
,
err
...
...
internal/dao/integrate_settings.go
浏览文件 @
bd71a4ab
...
...
@@ -146,12 +146,10 @@ func (model *SysSettingModel) GetCompileEnvByName(compileEnvItem string) (*model
}
// GetCompileEnvs ...
func
(
model
*
SysSettingModel
)
GetCompileEnvs
(
integrateType
string
)
([]
*
models
.
CompileEnv
,
error
)
{
func
(
model
*
SysSettingModel
)
GetCompileEnvs
()
([]
*
models
.
CompileEnv
,
error
)
{
integrateSettings
:=
[]
*
models
.
CompileEnv
{}
qs
:=
model
.
ormer
.
QueryTable
(
model
.
CompileEnvTableName
)
.
Filter
(
"deleted"
,
false
)
if
integrateType
!=
""
{
qs
=
qs
.
Filter
(
"type"
,
integrateType
)
}
_
,
err
:=
qs
.
All
(
&
integrateSettings
)
if
err
!=
nil
{
return
nil
,
err
...
...
internal/migrations/migration20220415.go
浏览文件 @
bd71a4ab
...
...
@@ -39,8 +39,33 @@ func (m Migration20220415) Upgrade(ormer orm.Ormer) error {
// init component
_
=
initComponent
()
compileEnvs
:=
[]
settings
.
CompileEnvReq
{
{
Name
:
"jnlp"
,
Image
:
"colynn/jenkins-jnlp-agent:latest"
,
Description
:
""
,
},
{
Name
:
"kaniko"
,
Image
:
"colynn/kaniko-executor:debug"
,
Command
:
"/bin/sh -c"
,
Args
:
"cat"
,
},
{
Name
:
"node"
,
Image
:
"node:12.12-alpine"
,
Description
:
"nodejs编译环境"
,
},
{
Name
:
"maven"
,
Image
:
"maven:3.8.2-openjdk-8"
,
Command
:
"/bin/sh -c"
,
Args
:
"cat"
,
},
}
// init compile envs
_
=
initCompileEnvs
()
_
=
initCompileEnvs
(
compileEnvs
)
// init task tmpls
_
=
initTaskTemplates
()
...
...
@@ -93,32 +118,7 @@ func initComponent() error {
return
nil
}
var
compileEnvs
=
[]
settings
.
CompileEnvReq
{
{
Name
:
"jnlp"
,
Image
:
"colynn/jenkins-jnlp-agent:latest"
,
Description
:
""
,
},
{
Name
:
"kaniko"
,
Image
:
"colynn/kaniko-executor:debug"
,
Command
:
"/bin/sh -c"
,
Args
:
"cat"
,
},
{
Name
:
"node"
,
Image
:
"node:12.12-alpine"
,
Description
:
"nodejs编译环境"
,
},
{
Name
:
"maven"
,
Image
:
"maven:3.8.2-openjdk-8"
,
Command
:
"/bin/sh -c"
,
Args
:
"cat"
,
},
}
func
initCompileEnvs
()
error
{
func
initCompileEnvs
(
compileEnvs
[]
settings
.
CompileEnvReq
)
error
{
settingModel
:=
dao
.
NewSysSettingModel
()
for
_
,
item
:=
range
compileEnvs
{
_
,
err
:=
settingModel
.
GetCompileEnvByName
(
item
.
Name
)
...
...
internal/migrations/migration20230703.go
0 → 100644
浏览文件 @
bd71a4ab
/*
Copyright 2021 The AtomCI Group Authors.
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.
*/
package
migrations
import
(
"time"
"github.com/astaxie/beego/orm"
"github.com/go-atomci/atomci/internal/core/settings"
)
type
Migration20230703
struct
{
}
func
(
m
Migration20230703
)
GetCreateAt
()
time
.
Time
{
return
time
.
Date
(
2023
,
7
,
03
,
0
,
0
,
0
,
0
,
time
.
Local
)
}
func
(
m
Migration20230703
)
Upgrade
(
ormer
orm
.
Ormer
)
error
{
addedCompileEnvs
:=
[]
settings
.
CompileEnvReq
{
{
Name
:
"checkout"
,
Image
:
"colynn/checkout:latest"
,
Description
:
"代码检出"
,
},
}
// init compile envs
_
=
initCompileEnvs
(
addedCompileEnvs
)
// update origin jnlp image
return
updateCompileEnvs
(
ormer
)
}
func
updateCompileEnvs
(
ormer
orm
.
Ormer
)
error
{
_
,
err
:=
ormer
.
Raw
(
"UPDATE `sys_compile_env` SET `image`='jenkins/inbound-agent:latest' WHERE `name`='jnlp';"
)
.
Exec
()
if
err
!=
nil
{
return
err
}
return
nil
}
internal/migrations/migrations.go
浏览文件 @
bd71a4ab
...
...
@@ -56,6 +56,7 @@ func initMigration() {
new
(
Migration20220324
),
new
(
Migration20220414
),
new
(
Migration20220415
),
new
(
Migration20230703
),
}
migrateInTx
(
migrationTypes
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录