Skip to content

Commit 0951ca4

Browse files
authored
Merge pull request #235 from michelsciortino/ms-fixing-jenkins-tests
Adding Clean Directory and Checkout + after-tests namespaces cleaning
2 parents d0386fc + e68e7a8 commit 0951ca4

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

CI/JenkinsfileTestCleanInstance

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def slackNotification(buildStatus,String notification_url = "",project_name = ""
3131
]
3232
]
3333
)
34-
3534
sh "curl -X POST --fail -H 'Content-type: application/json' --data '${payload}' ${notification_url}"
3635
}
3736

@@ -89,6 +88,14 @@ pipeline {
8988
}
9089
}
9190
}
91+
stage ('Clean Directory and Checkout') {
92+
steps {
93+
dir('.') {
94+
deleteDir()
95+
}
96+
checkout scm
97+
}
98+
}
9299
stage('Build Base Image') {
93100
when {
94101
triggeredBy 'TimerTrigger'

CI/clean_slave.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ for lib in $(ls /lib/x86_64-linux-gnu/ | grep -P "libnl"); do
2929
echo "removing /lib/x86_64-linux-gnu/$lib"
3030
sudo rm -rf /lib/x86_64-linux-gnu/$lib
3131
done
32-
sudo ldconfig
32+
sudo ldconfig
33+
for namespace in $(ls /var/run/netns/ | grep -Po "ns[0-9]"); do
34+
echo "removing namespace $namespace"
35+
sudo ip netns del $namespace
36+
done

0 commit comments

Comments
 (0)