8 changed files with 162 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||
|
kind: pipeline |
||||
|
type: kubernetes |
||||
|
name: default |
||||
|
|
||||
|
clone: |
||||
|
pull: if-not-exists |
||||
|
|
||||
|
steps: |
||||
|
- name: test |
||||
|
image: golang:1.16.8-buster |
||||
|
# trigger: |
||||
|
# branch: |
||||
|
# - test |
||||
|
# event: |
||||
|
# - push |
||||
@ -0,0 +1,31 @@ |
|||||
|
#!/bin/sh |
||||
|
|
||||
|
# 用 `` 可以将命令的输出结果赋值给变量 |
||||
|
# 获取当前提交的 commit msg |
||||
|
commit_msg=`cat $1` |
||||
|
|
||||
|
# 获取用户 email |
||||
|
email=`git config user.email` |
||||
|
msg_re="^(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|release|workflow)(\(.+\))?: .{1,100}" |
||||
|
|
||||
|
if [[ ! $commit_msg =~ $msg_re ]] |
||||
|
then |
||||
|
echo "\n不合法的 commit 消息提交格式,请使用正确的格式:\ |
||||
|
\nfeat: add comments\ |
||||
|
\nfix: handle events on blur (close #28)\ |
||||
|
\n详情请查看 git commit 提交规范:https://github.com/woai3c/Front-end-articles/blob/master/git%20commit%20style.md" |
||||
|
|
||||
|
# 异常退出 |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
# 对用户权限做判断则比较简单,只需要检查用户的邮箱或用户名就可以了 |
||||
|
#(假设现在只有 abc 公司的员工才有权限提交代码)。 |
||||
|
email_re="@abc\.com" |
||||
|
if [[ ! $email =~ $email_re ]] |
||||
|
then |
||||
|
echo "此用户没有权限,具有权限的用户为: xxx@abc.com" |
||||
|
|
||||
|
# 异常退出 |
||||
|
exit 1 |
||||
|
fi |
||||
@ -0,0 +1,6 @@ |
|||||
|
#!/bin/sh |
||||
|
npm run lint |
||||
|
|
||||
|
# 获取上面脚本的退出码 |
||||
|
exitCode="$?" |
||||
|
exit $exitCode |
||||
@ -0,0 +1,24 @@ |
|||||
|
{ |
||||
|
"branches": ["master", "test"], |
||||
|
"plugins": [ |
||||
|
["@semantic-release/commit-analyzer", { |
||||
|
"preset": "angular", |
||||
|
"releaseRules": [ |
||||
|
{"type": "docs", "scope":"README", "release": "patch"}, |
||||
|
{"type": "refactor", "release": "patch"}, |
||||
|
{"type": "style", "release": "patch"} |
||||
|
], |
||||
|
"parserOpts": { |
||||
|
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"] |
||||
|
} |
||||
|
}], |
||||
|
"@semantic-release/release-notes-generator", |
||||
|
"@semantic-release/changelog", |
||||
|
"@semantic-release/git", |
||||
|
["@saithodev/semantic-release-gitea", { |
||||
|
"giteaUrl": "https://git.1000my.com", |
||||
|
{"path": ".", "label": "源文件代码"} |
||||
|
}], |
||||
|
], |
||||
|
"tagFormat": "${process.env.GOOS}_v${version}" |
||||
|
} |
||||
@ -0,0 +1,3 @@ |
|||||
|
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base |
||||
|
#拷贝项目publish文件夹中的所有文件到 docker容器中的publish文件夹中 |
||||
|
# COPY . /publish |
||||
Loading…
Reference in new issue