提交 a4d9d234 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Auto commit by hugo-plugin.

上级 d552fa03
......@@ -244,29 +244,29 @@
<a href="/event/hangzhou-2019-05/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hangzhou.jpeg"></img>
<a href="/event/wuhang/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hacktberfest.jpg"></img>
</a>
<a href="/event/wuhang/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hacktberfest.jpg"></img>
<a href="/event/beijing-2019-04-20/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/cloud-native-community-day.jpeg"></img>
</a>
<a href="/event/shenzhen/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/shenzhen.jpeg"></img>
<a href="/event/hangzhou-2019-05/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hangzhou.jpeg"></img>
</a>
<a href="/event/beijing-2019-04-20/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/cloud-native-community-day.jpeg"></img>
<a href="/event/beijing-2019-11/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hacktberfest.jpg"></img>
</a>
......@@ -279,8 +279,8 @@
<a href="/event/beijing-2019-11/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/hacktberfest.jpg"></img>
<a href="/event/shenzhen/" class="tile lazyload cover dib f4 ml1 mr4 bg-black relative mw-100 shadow-5">
<img width="400px" height="200px" src="/images/meetup/shenzhen.jpeg"></img>
</a>
......
......@@ -159,6 +159,31 @@
<section class="flex-ns flex-wrap justify-between w-100">
<div class="relative weight-0" style="max-width: 350px">
<div class="bg-white mb2 pa3 pa4-l gray">
<h1 class="near-black f3">
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="link primary-color dim">应该使用什么 CI/CD 工具?</a>
</h1>
<div class="lh-copy links">
了解典型自动化 CI/CD 部署流水线的组件以及您需要的组件。
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="f6 mt2 db link primary-color dim">
查看更多 &raquo;
</a>
</div>
</div>
</div>
<div class="relative weight-0" style="max-width: 350px">
......
......@@ -159,6 +159,31 @@
<section class="flex-ns flex-wrap justify-between w-100">
<div class="relative weight-0" style="max-width: 350px">
<div class="bg-white mb2 pa3 pa4-l gray">
<h1 class="near-black f3">
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="link primary-color dim">应该使用什么 CI/CD 工具?</a>
</h1>
<div class="lh-copy links">
了解典型自动化 CI/CD 部署流水线的组件以及您需要的组件。
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="f6 mt2 db link primary-color dim">
查看更多 &raquo;
</a>
</div>
</div>
</div>
<div class="relative weight-0" style="max-width: 350px">
......
......@@ -159,6 +159,31 @@
<section class="flex-ns flex-wrap justify-between w-100">
<div class="relative weight-0" style="max-width: 350px">
<div class="bg-white mb2 pa3 pa4-l gray">
<h1 class="near-black f3">
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="link primary-color dim">应该使用什么 CI/CD 工具?</a>
</h1>
<div class="lh-copy links">
了解典型自动化 CI/CD 部署流水线的组件以及您需要的组件。
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="f6 mt2 db link primary-color dim">
查看更多 &raquo;
</a>
</div>
</div>
</div>
<div class="relative weight-0" style="max-width: 350px">
......
def isEmpty(str){
return str == "" || str == null
}
pipeline {
agent any
......@@ -15,16 +11,7 @@ pipeline {
script{
withChangeSets(){
if(env.changePath != "" && env.changePath != null && env.changePath.endsWith(".md")) {
def articles = readYaml file: env.changePath
def article = articles[0]
if(isEmpty(article.title) || isEmpty(article.description)
|| isEmpty(article.author) || isEmpty(article.poster)){
error "title, description, author or poster can not be empty"
}
if(!isEmpty(article.translator) && isEmpty(article.original)) {
error "current article is translated from the origin one, please provide the original link"
}
checkArticleMeta(env.changePath)
}
}
}
......@@ -33,5 +20,40 @@ pipeline {
}
}
def checkArticleMeta(filePath){
def articleText = readFile encoding: 'UTF-8', file: filePath
def articleYamlText = getYamlMeta(articleText)
if(isEmpty(articleYamlText)){
error "cannot find the yaml meta from current article"
}
def articles = readYaml file: articleYamlText
def article = articles[0]
if(isEmpty(article.title) || isEmpty(article.description)
|| isEmpty(article.author) || isEmpty(article.poster)){
error "title, description, author or poster can not be empty"
}
if(!isEmpty(article.translator) && isEmpty(article.original)) {
error "current article is translated from the origin one, please provide the original link"
}
}
def isEmpty(str){
return str == "" || str == null
}
def getYamlMeta(txt){
def firstIndex = txt.indexOf('---')
if(firstIndex == -1){
return ""
}
def secondIndex = txt.indexOf('---', firstIndex + 3)
if(secondIndex == -1){
return ""
}
return txt.substring(firstIndex, secondIndex + 3)
}
// DSL withChangeSets has not been released, see also
// https://github.com/LinuxSuRen/change-handler
\ No newline at end of file
......@@ -159,6 +159,31 @@
<section class="flex-ns flex-wrap justify-between w-100">
<div class="relative weight-0" style="max-width: 350px">
<div class="bg-white mb2 pa3 pa4-l gray">
<h1 class="near-black f3">
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="link primary-color dim">应该使用什么 CI/CD 工具?</a>
</h1>
<div class="lh-copy links">
了解典型自动化 CI/CD 部署流水线的组件以及您需要的组件。
<a href="/wechat/articles/2019/04/2019-04-30-what-cicd-tool-should-i-use/" class="f6 mt2 db link primary-color dim">
查看更多 &raquo;
</a>
</div>
</div>
</div>
<div class="relative weight-0" style="max-width: 350px">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册