Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ def testinfo_data = ""
def ci_git_commit = ""
def global_sum_log = ""
def added_commits = ""
def builder_node = ""
def builder_wspace = ""
def slot_name = "ci-"
// reasonable value: keep few recent, dont take risk to fill disk
int num_build_dirs_to_keep = 4
int num_builds_to_keep = 4

// Define global environment common for all docker sessions
def script_env = """
Expand All @@ -49,9 +47,6 @@ try {
timestamps {
node('rk-docker') {
ws("workspace/${slot_name}${ci_build_id}") {
// remember node and workspace needed by workspace cleaner
builder_node = "${env.NODE_NAME}"
builder_wspace = "${env.WORKSPACE}"
set_gh_status_pending(is_pr, 'Prepare for build')
stage('Cleanup workspace') {
deleteDir()
Expand All @@ -60,7 +55,10 @@ try {
checkout_content(is_pr)
}
stage('Build docker image') {
build_docker_image(image_name)
parallel(
"build-docker-image": { build_docker_image(image_name) },
"cleanup": { ws("workspace") { trim_build_dirs(slot_name, num_builds_to_keep) }}
)
}
def docker_image = docker.image(image_name)
run_args = ["--device=/dev/kvm -v ${env.PUBLISH_DIR}:${env.PUBLISH_DIR}:rw",
Expand Down Expand Up @@ -105,15 +103,6 @@ try {
} // node
} // timestamps

// insert older trees deletion job into tester jobs array
test_runs["clean_older_workspaces"] = {
node(builder_node) {
ws("workspace") {
trim_build_dirs(slot_name, num_build_dirs_to_keep)
}
}
}

test_targets = testinfo_data.split("\n")
for(int i = 0; i < test_targets.size() && test_targets[i] != ""; i++) {
def one_target_testinfo = test_targets[i]
Expand Down