Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Jenkins 中文社区
Wechat Backend
提交
de463ffe
W
Wechat Backend
项目概览
Jenkins 中文社区
/
Wechat Backend
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
Wechat Backend
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
de463ffe
编写于
5月 30, 2019
作者:
Z
Zhao Xiaojie
提交者:
GitHub
5月 30, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13 from LinuxSuRen/build-pipeline
Fix the pipeline script
上级
8157088c
f852ede0
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
77 addition
and
33 deletion
+77
-33
Jenkinsfile
Jenkinsfile
+50
-6
README.md
README.md
+1
-1
main.go
main.go
+5
-5
menu.go
menu.go
+1
-1
pkg/article/articles.go
pkg/article/articles.go
+2
-2
pkg/article/articles_test.go
pkg/article/articles_test.go
+1
-1
pkg/github/webhook.go
pkg/github/webhook.go
+1
-1
pkg/mock/article/articles-mock.go
pkg/mock/article/articles-mock.go
+1
-1
pkg/reply/core.go
pkg/reply/core.go
+1
-1
pkg/reply/match.go
pkg/reply/match.go
+2
-2
pkg/reply/match_test.go
pkg/reply/match_test.go
+2
-2
pkg/reply/search.go
pkg/reply/search.go
+2
-2
pkg/reply/search_test.go
pkg/reply/search_test.go
+1
-1
pkg/reply/unknown.go
pkg/reply/unknown.go
+1
-1
pkg/reply/unknown_test.go
pkg/reply/unknown_test.go
+1
-1
pkg/reply/welcome.go
pkg/reply/welcome.go
+1
-1
pkg/reply/welcome_test.go
pkg/reply/welcome_test.go
+2
-2
token.go
token.go
+1
-1
vendor/vendor.json
vendor/vendor.json
+1
-1
未找到文件。
Jenkinsfile
浏览文件 @
de463ffe
def
scmObj
pipeline
{
agent
{
label
"golang"
}
environment
{
FOLDER
=
'src/github.com/jenkins-zh/wechat-backend'
}
stages
{
stage
(
"clone"
)
{
steps
{
dir
(
FOLDER
)
{
script
{
scmObj
=
checkout
scm
}
}
}
}
stage
(
"build"
)
{
environment
{
GOPATH
=
"${WORKSPACE}"
}
steps
{
sh
'make build'
dir
(
FOLDER
)
{
container
(
'golang'
){
sh
'''
CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" -a -installsuffix cgo -o bin/wechat-backend
'''
}
container
(
'tools'
)
{
sh
'upx bin/wechat-backend'
}
}
}
}
stage
(
"image"
)
{
environment
{
IMAGE_TAG
=
getCurrentCommit
(
scmObj
)
}
steps
{
sh
'make image'
container
(
'tools'
){
dir
(
FOLDER
)
{
sh
'''
docker build -t surenpi/jenkins-wechat:$IMAGE_TAG .
'''
}
}
}
}
stage
(
"push-image"
)
{
environment
{
DOCKER_CREDS
=
credentials
(
'docker-surenpi'
)
IMAGE_TAG
=
getCurrentCommit
(
scmObj
)
}
steps
{
withCredentials
([
usernamePassword
(
credentialsId:
''
,
passwordVariable:
'passwd'
,
usernameVariable:
'user'
)]
)
{
container
(
'tools'
)
{
sh
'''
docker login -u $
user -p $passwd
make push-image
docker login -u $
DOCKER_CREDS_USR -p $DOCKER_CREDS_PSW
docker push surenpi/jenkins-wechat:$IMAGE_TAG
docker logout
'''
}
}
}
}
}
\ No newline at end of file
}
def
getCurrentCommit
(
scmObj
)
{
return
scmObj
.
GIT_COMMIT
}
README.md
浏览文件 @
de463ffe
...
...
@@ -14,7 +14,7 @@ Sample config.yaml:
```
token: wechat-token
git_url: https://github.com/
linuxsuren
/wechat
git_url: https://github.com/
jenkins-zh
/wechat
git_branch: master
github_webhook_secret: github-secret
appID: wechat-appid
...
...
main.go
浏览文件 @
de463ffe
...
...
@@ -11,11 +11,11 @@ import (
"sort"
"strings"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
"github.com/
linuxsuren
/wechat-backend/pkg/article"
"github.com/
linuxsuren
/wechat-backend/pkg/config"
"github.com/
linuxsuren
/wechat-backend/pkg/github"
"github.com/
linuxsuren
/wechat-backend/pkg/reply"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
"github.com/
jenkins-zh
/wechat-backend/pkg/article"
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
"github.com/
jenkins-zh
/wechat-backend/pkg/github"
"github.com/
jenkins-zh
/wechat-backend/pkg/reply"
)
// WeChat represents WeChat
...
...
menu.go
浏览文件 @
de463ffe
...
...
@@ -6,7 +6,7 @@ import (
"net/http"
"strings"
"github.com/
linuxsuren
/wechat-backend/pkg/config"
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
)
func
PushWxMenuCreate
(
accessToken
string
,
menuJsonBytes
[]
byte
)
error
{
...
...
pkg/article/articles.go
浏览文件 @
de463ffe
...
...
@@ -8,8 +8,8 @@ import (
"strings"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
"github.com/
linuxsuren
/wechat-backend/pkg/config"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/yaml.v2"
)
...
...
pkg/article/articles_test.go
浏览文件 @
de463ffe
...
...
@@ -3,7 +3,7 @@ package article
import
(
"testing"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
"github.com/stretchr/testify/assert"
)
...
...
pkg/github/webhook.go
浏览文件 @
de463ffe
...
...
@@ -4,7 +4,7 @@ import (
"log"
"net/http"
"github.com/
linuxsuren
/wechat-backend/pkg/config"
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
"gopkg.in/go-playground/webhooks.v5/github"
)
...
...
pkg/mock/article/articles-mock.go
浏览文件 @
de463ffe
...
...
@@ -6,7 +6,7 @@ package mock_article
import
(
gomock
"github.com/golang/mock/gomock"
config
"github.com/
linuxsuren
/wechat-backend/pkg/config"
config
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
reflect
"reflect"
)
...
...
pkg/reply/core.go
浏览文件 @
de463ffe
...
...
@@ -4,7 +4,7 @@ import (
"encoding/xml"
"time"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
)
// AutoReply represent auto reply interface
...
...
pkg/reply/match.go
浏览文件 @
de463ffe
...
...
@@ -4,8 +4,8 @@ import (
"fmt"
"log"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
"github.com/
linuxsuren
/wechat-backend/pkg/article"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
"github.com/
jenkins-zh
/wechat-backend/pkg/article"
)
var
responseManager
article
.
ResponseManager
...
...
pkg/reply/match_test.go
浏览文件 @
de463ffe
...
...
@@ -4,8 +4,8 @@ import (
"testing"
"github.com/golang/mock/gomock"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
mArticle
"github.com/
linuxsuren
/wechat-backend/pkg/mock/article"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
mArticle
"github.com/
jenkins-zh
/wechat-backend/pkg/mock/article"
)
func
TestAccept
(
t
*
testing
.
T
)
{
...
...
pkg/reply/search.go
浏览文件 @
de463ffe
...
...
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
"github.com/
linuxsuren
/wechat-backend/pkg/article"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
"github.com/
jenkins-zh
/wechat-backend/pkg/article"
)
// SearchAutoReply only reply for match
...
...
pkg/reply/search_test.go
浏览文件 @
de463ffe
...
...
@@ -3,7 +3,7 @@ package reply
import
(
"testing"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
)
func
TestSearch
(
t
*
testing
.
T
)
{
...
...
pkg/reply/unknown.go
浏览文件 @
de463ffe
...
...
@@ -3,7 +3,7 @@ package reply
import
(
"math"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
)
// UnknownAutoReply unknown auto reply
...
...
pkg/reply/unknown_test.go
浏览文件 @
de463ffe
...
...
@@ -4,7 +4,7 @@ import (
"testing"
"github.com/golang/mock/gomock"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
)
...
...
pkg/reply/welcome.go
浏览文件 @
de463ffe
...
...
@@ -3,7 +3,7 @@ package reply
import
(
"fmt"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
)
// WelcomeReply for welcome event
...
...
pkg/reply/welcome_test.go
浏览文件 @
de463ffe
...
...
@@ -4,8 +4,8 @@ import (
"testing"
"github.com/golang/mock/gomock"
core
"github.com/
linuxsuren
/wechat-backend/pkg"
mArticle
"github.com/
linuxsuren
/wechat-backend/pkg/mock/article"
core
"github.com/
jenkins-zh
/wechat-backend/pkg"
mArticle
"github.com/
jenkins-zh
/wechat-backend/pkg/mock/article"
)
func
TestWelcome
(
t
*
testing
.
T
)
{
...
...
token.go
浏览文件 @
de463ffe
...
...
@@ -6,7 +6,7 @@ import (
"net/http"
"strings"
"github.com/
linuxsuren
/wechat-backend/pkg/config"
"github.com/
jenkins-zh
/wechat-backend/pkg/config"
)
//https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
...
...
vendor/vendor.json
浏览文件 @
de463ffe
...
...
@@ -521,5 +521,5 @@
"revisionTime"
:
"2018-03-28T19:50:20Z"
}
],
"rootPath"
:
"github.com/
linuxsuren
/wechat-backend/pkg/"
"rootPath"
:
"github.com/
jenkins-zh
/wechat-backend/pkg/"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录