Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
go-atomci
atomci
提交
726c31c0
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 搜索 >>
提交
726c31c0
编写于
6月 06, 2022
作者:
C
colynn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add version print
上级
3084534c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
4 deletion
+18
-4
Dockerfile
Dockerfile
+2
-2
Makefile
Makefile
+13
-1
cmd/atomci/main.go
cmd/atomci/main.go
+3
-1
未找到文件。
Dockerfile
浏览文件 @
726c31c0
## build
FROM
golang:1.15-alpine AS build-env
FROM
colynn/
golang:1.15-alpine AS build-env
ADD
. /go/src/atomci
WORKDIR
/go/src/atomci
RUN
go build ./cmd/atomci
RUN
make build
## run
FROM
alpine:3.9
...
...
Makefile
浏览文件 @
726c31c0
...
...
@@ -8,6 +8,18 @@ NAME = atomci
export
CGO_ENABLED
:=
${CGO_ENABLED}
export
PROJECT_ROOT
:=
$(CURDIR)
VERSION
:=
v1.5.1
BuildTS
=
$(
shell
date
-u
'+%Y-%m-%d %I:%M:%S'
)
COMMIT_ID
=
$(
shell
git rev-parse
--short
HEAD
)
BRANCH_NAME
=
$(
shell
git rev-parse
--abbrev-ref
HEAD
)
project
=
$(
shell
go list
-m
)
LDFLAGS
+=
-X
"
$(project)
/version.BuildTS=
$(BuildTS)
"
LDFLAGS
+=
-X
"
$(project)
/version.GitHash=
$(COMMIT_ID)
"
LDFLAGS
+=
-X
"
$(project)
/version.Version=
$(VERSION)
"
LDFLAGS
+=
-X
"
$(project)
/version.GitBranch=
$(BRANCH_NAME)
"
## linux-amd64: Compile linux-amd64 package
linux-amd64
:
@
env
GOOS
=
linux
GOARCH
=
amd64 go build
-o
deploy/binary/
$(NAME)
-linux-amd64
cmd/atomci/main.go
...
...
@@ -19,7 +31,7 @@ linux-arm64:
.PHONY
:
build
## build: Compile the packages.
build
:
@
go build
-o
$(NAME)
cmd/atomci/main.go
@
go build
-
ldflags
'
$(LDFLAGS)
'
-
o
$(NAME)
cmd/atomci/main.go
.PHONY
:
run
## run: Build and Run in local mode.
...
...
cmd/atomci/main.go
浏览文件 @
726c31c0
...
...
@@ -25,6 +25,7 @@ import (
"github.com/go-atomci/atomci/internal/initialize"
"github.com/go-atomci/atomci/internal/migrations"
"github.com/go-atomci/atomci/internal/models"
"github.com/go-atomci/atomci/version"
"github.com/go-atomci/atomci/internal/cronjob"
"github.com/go-atomci/atomci/internal/routers"
...
...
@@ -37,9 +38,10 @@ func main() {
initialize
.
Init
()
cronjob
.
RunPublishJobServer
()
beego
.
Info
(
"Beego version:"
,
beego
.
VERSION
)
routers
.
RegisterRoutes
()
beego
.
Info
(
"Beego version:"
,
beego
.
VERSION
)
beego
.
Info
(
"Golang version:"
,
runtime
.
Version
())
version
.
PrintFullVersionInfo
()
beego
.
Run
()
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录