Skip to content

Commit 77e8501

Browse files
committed
ci: simplify jenkins scripts
~ move most of the code logic to the backend Signed-off-by: Vitor Bandeira <[email protected]>
1 parent 06469a8 commit 77e8501

File tree

2 files changed

+11
-118
lines changed

2 files changed

+11
-118
lines changed
Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,29 @@
1-
@Library('utils@main') _
1+
@Library('utils@orfs-v2.0.1') _
22

3-
node {
3+
node('ubuntu22') {
44

5-
properties([
6-
copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME),
7-
]);
5+
properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME)]);
86

97
stage('Checkout') {
108
checkout scm;
119
}
1210

13-
def commitHash = "none";
14-
def DOCKER_IMAGE_TAG = "latest";
11+
def DOCKER_IMAGE;
1512
stage('Build and Push Docker Image') {
16-
if (isDependencyInstallerChanged(env.BRANCH_NAME)) {
17-
commitHash = sh(script: 'git rev-parse HEAD', returnStdout: true);
18-
commitHash = commitHash.replaceAll(/[^a-zA-Z0-9-]/, '');
19-
DOCKER_IMAGE_TAG = pushCIImage(env.BRANCH_NAME, commitHash);
20-
}
13+
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'orfs');
14+
echo "Docker image is $DOCKER_IMAGE";
2115
}
22-
def DOCKER_IMAGE = "openroad/flow-ubuntu22.04-dev:${DOCKER_IMAGE_TAG}";
2316

24-
docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
25-
stage('Build ORFS and Stash bins') {
26-
sh "git config --system --add safe.directory '*'";
27-
localBuild();
28-
}
17+
stage('Build ORFS and Stash bins') {
18+
buildBins(DOCKER_IMAGE);
2919
}
3020

3121
stage('Run Tests') {
32-
Map tasks = [failFast: false];
33-
def test_slugs = getTestSlugs("all");
34-
for (test in test_slugs) {
35-
def currentSlug = test; // copy needed to correctly pass args to runTests
36-
tasks["${test}"] = {
37-
node {
38-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
39-
docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
40-
sh "git config --system --add safe.directory '*'";
41-
checkout scm;
42-
runTests(currentSlug);
43-
}
44-
}
45-
}
46-
}
47-
}
48-
parallel(tasks);
22+
runTests(DOCKER_IMAGE, 'pr');
4923
}
5024

51-
docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
52-
sh "git config --system --add safe.directory '*'";
53-
stage('Report Summary') {
54-
generateReportShortSummary();
55-
}
56-
stage("Report HTML Table") {
57-
generateReportHtmlTable();
58-
}
59-
stage('Upload Metadata') {
60-
uploadMetadata(env.BRANCH_NAME, commitHash);
61-
}
62-
stage('Send Report') {
63-
def COMMIT_AUTHOR_EMAIL = sh(script: "git --no-pager show -s --format='%ae'", returnStdout: true).trim();
64-
sendEmail(env.BRANCH_NAME, COMMIT_AUTHOR_EMAIL);
65-
}
25+
stage ('Cleanup and Reporting') {
26+
finalReport(DOCKER_IMAGE);
6627
}
6728

6829
}

jenkins/public_tests_small.Jenkinsfile

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)