3 Star 3 Fork 1

Rick / kubernetes-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
containerLog.groovy 952 Bytes
一键复制 编辑 原始数据 按行查看 历史
podTemplate(yaml: """
apiVersion: v1
kind: Pod
metadata:
labels:
some-label: some-label-value
spec:
containers:
- name: maven
image: maven:3.3.9-jdk-8-alpine
command: ['cat']
tty: true
- name: mongo
image: mongo
"""
) {
node(POD_LABEL) {
stage('Integration Test') {
try {
container('maven') {
sh 'nc -z localhost:27017 && echo "connected to mongo db"'
// sh 'mvn -B clean failsafe:integration-test' // real integration test
def mongoLog = containerLog(name: 'mongo', returnLog: true, tailingLines: 5, sinceSeconds: 20, limitBytes: 50000)
assert mongoLog.contains('connection accepted from 127.0.0.1:')
sh 'echo failing build; false'
}
} catch (Exception e) {
containerLog 'mongo'
throw e
}
}
}
}
Java
1
https://gitee.com/linuxsuren/kubernetes-plugin.git
git@gitee.com:linuxsuren/kubernetes-plugin.git
linuxsuren
kubernetes-plugin
kubernetes-plugin
master

搜索帮助