-
Notifications
You must be signed in to change notification settings - Fork 113
feat(ci): refactor tidb-test latest stage agents #4623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,18 +10,20 @@ final POD_TEMPLATE_FILE = "pipelines/${GIT_FULL_REPO_NAME}/${BRANCH_ALIAS}/${JOB | |
| final REFS = readJSON(text: params.JOB_SPEC).refs | ||
|
|
||
| pipeline { | ||
| agent { | ||
| kubernetes { | ||
| namespace K8S_NAMESPACE | ||
| yamlFile POD_TEMPLATE_FILE | ||
| defaultContainer 'golang' | ||
| } | ||
| } | ||
| agent none | ||
| options { | ||
| timeout(time: 30, unit: 'MINUTES') | ||
| } | ||
| stages { | ||
| stage('Checkout') { | ||
| agent { | ||
| kubernetes { | ||
| namespace K8S_NAMESPACE | ||
| yamlFile POD_TEMPLATE_FILE | ||
| retries 2 | ||
| defaultContainer 'golang' | ||
| } | ||
| } | ||
| options { timeout(time: 5, unit: 'MINUTES') } | ||
| steps { | ||
| dir("tidb") { | ||
|
|
@@ -45,8 +47,24 @@ pipeline { | |
| } | ||
| } | ||
| stage("Build"){ | ||
| agent { | ||
| kubernetes { | ||
| namespace K8S_NAMESPACE | ||
| yamlFile POD_TEMPLATE_FILE | ||
| retries 2 | ||
| defaultContainer 'golang' | ||
| } | ||
| } | ||
| steps { | ||
| dir("tidb") { | ||
| cache(path: "./", includes: '**/*', key: "git/pingcap/tidb/rev-${REFS.pulls[0].sha}}", restoreKeys: ['git/pingcap/tidb/rev-']) { | ||
| sh label: 'restore tidb', script: 'git rev-parse HEAD' | ||
| } | ||
| } | ||
| dir("tidb-test") { | ||
| cache(path: "./", includes: '**/*', key: "git/PingCAP-QE/tidb-test/rev-${REFS.pulls[0].sha}}", restoreKeys: ['git/PingCAP-QE/tidb-test/rev-']) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a typo in the cache key: an extra closing brace References
|
||
| sh label: 'restore tidb-test', script: 'git rev-parse HEAD' | ||
| } | ||
| sh """ | ||
| TIDB_SRC_PATH=${WORKSPACE}/tidb make check | ||
| """ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo in the cache key: an extra closing brace
}at the end of the string interpolation${REFS.pulls[0].sha}}. For better consistency and robustness, it is recommended to useprow.getCacheKey('git', REFS)instead of hardcoding the key. Please also check and fix the same typo in the Checkout stage (line 30).References