Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
76b35b84
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76b35b84
编写于
6月 18, 2020
作者:
R
Robert Metzger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-18125][Azure] Skip e2e execution on docs-only-PRs
This closes #12708
上级
2d371eb5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
85 addition
and
7 deletion
+85
-7
tools/azure-pipelines/build_properties.sh
tools/azure-pipelines/build_properties.sh
+55
-0
tools/azure-pipelines/free_disk_space.sh
tools/azure-pipelines/free_disk_space.sh
+1
-0
tools/azure-pipelines/jobs-template.yml
tools/azure-pipelines/jobs-template.yml
+29
-7
未找到文件。
tools/azure-pipelines/build_properties.sh
0 → 100755
浏览文件 @
76b35b84
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Returns 0 if the change is a documentation-only pull request
#
function
is_docs_only_pullrequest
()
{
# check if it is a pull request branch, as generated by ci-bot:
if
[[
!
$BUILD_SOURCEBRANCHNAME
==
ci_
*
]]
;
then
echo
"INFO: Not a pull request."
;
return
1
fi
PR_ID
=
`
echo
"
$BUILD_SOURCEBRANCHNAME
"
|
cut
-f2
-d_
`
if
!
[[
"
$PR_ID
"
=
~ ^[0-9]+
$
]]
;
then
echo
"ERROR: Extracted PR_ID is not a number, but this: '
$PR_ID
'"
return
1
fi
# check if it is docs only pull request
# 1. Get PR details
GITHUB_PULL_DETAIL
=
`
curl
--silent
"https://api.github.com/repos/apache/flink/pulls/
$PR_ID
"
`
# 2. Check if this build is in sync with the PR
GITHUB_PULL_HEAD_SHA
=
`
echo
$GITHUB_PULL_DETAIL
| jq
-r
".head.sha"
`
THIS_BRANCH_SHA
=
`
git rev-parse HEAD
`
if
[[
"
$GITHUB_PULL_HEAD_SHA
"
!=
"
$THIS_BRANCH_SHA
"
]]
;
then
echo
"INFO: SHA mismatch: GITHUB_PULL_HEAD_SHA=
$GITHUB_PULL_HEAD_SHA
!= THIS_BRANCH_SHA=
$THIS_BRANCH_SHA
"
;
# sha mismatch. There's some timing issue, and we can't trust the result
return
1
fi
# 3. Get number of commits in PR
GITHUB_NUM_COMMITS
=
`
echo
$GITHUB_PULL_DETAIL
| jq
-r
".commits"
`
if
[[
$(
git diff
--name-only
HEAD..HEAD~
$GITHUB_NUM_COMMITS
|
grep
-v
"docs/"
)
==
""
]]
;
then
echo
"INFO: This is a docs only change. Changed files:"
git diff
--name-only
HEAD..HEAD~
$GITHUB_NUM_COMMITS
return
0
fi
return
1
}
tools/azure-pipelines/free_disk_space.sh
浏览文件 @
76b35b84
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
...
...
tools/azure-pipelines/jobs-template.yml
浏览文件 @
76b35b84
...
...
@@ -175,6 +175,18 @@ jobs:
workspace
:
clean
:
all
steps
:
# Skip e2e test execution if this is a documentation only pull request (master / release builds will still be checked regularly)
-
bash
:
|
source ./tools/azure-pipelines/build_properties.sh
is_docs_only_pullrequest
if [[ "$?" == 0 ]] ; then
echo "##[debug]This is a documentation-only change. Skipping e2e execution."
echo "##vso[task.setvariable variable=skip;]1"
else
echo "##[debug]This is a regular CI build. Continuing ..."
echo "##vso[task.setvariable variable=skip;]0"
fi
displayName
:
Check if Docs only PR
-
task
:
Cache@2
inputs
:
key
:
$(CACHE_KEY)
...
...
@@ -182,37 +194,47 @@ jobs:
path
:
$(MAVEN_CACHE_FOLDER)
displayName
:
Cache Maven local repo
continueOnError
:
true
condition
:
not(eq(variables['SKIP'], '1'))
-
task
:
Cache@2
inputs
:
key
:
e2e-cache | flink-end-to-end-tests/**/*.java, !**/avro/**
path
:
$(E2E_CACHE_FOLDER)
displayName
:
Cache E2E files
continueOnError
:
true
condition
:
not(eq(variables['SKIP'], '1'))
-
script
:
|
echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_11_X64"
echo "##vso[task.setvariable variable=PATH]$JAVA_HOME_11_X64/bin:$PATH"
displayName
:
"
Set
to
jdk11"
condition
:
eq('${{parameters.jdk}}', 'jdk11')
-
script
:
|
echo "Setting up Maven"
source ./tools/ci/maven-utils.sh
setup_maven
displayName
:
Setup Maven 3.2.5
-
script
:
./tools/azure-pipelines/setup_docker.sh
displayName
:
Setup Docker
-
script
:
./tools/azure-pipelines/free_disk_space.sh
displayName
:
Free up disk space
-
script
:
sudo apt-get install -y bc
echo "Setting up Docker"
./tools/azure-pipelines/setup_docker.sh
echo "Free up disk space"
./tools/azure-pipelines/free_disk_space.sh
echo "Installing required software"
sudo apt-get install -y bc
displayName
:
Prepare E2E run
condition
:
not(eq(variables['SKIP'], '1'))
-
script
:
${{parameters.environment}} ./tools/ci/compile.sh
displayName
:
Build Flink
condition
:
not(eq(variables['SKIP'], '1'))
-
script
:
${{parameters.environment}} FLINK_DIR=`pwd`/build-target flink-end-to-end-tests/run-nightly-tests.sh
displayName
:
Run e2e tests
env
:
IT_CASE_S3_BUCKET
:
$(SECRET_S3_BUCKET)
IT_CASE_S3_ACCESS_KEY
:
$(SECRET_S3_ACCESS_KEY)
IT_CASE_S3_SECRET_KEY
:
$(SECRET_S3_SECRET_KEY)
condition
:
not(eq(variables['SKIP'], '1'))
# upload debug artifacts
-
task
:
PublishPipelineArtifact@1
condition
:
and(succeededOrFailed(), not(eq(variables['ARTIFACT_DIR'], '')))
condition
:
and(succeededOrFailed(), not(eq(variables['
SKIP'], '1')), not(eq(variables['
ARTIFACT_DIR'], '')))
displayName
:
Upload Logs
inputs
:
targetPath
:
$(ARTIFACT_DIR)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录