diff --git a/Jenkinsfile b/Jenkinsfile index ab8e4e9..c6b1878 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,30 @@ pipeline { agent none stages { + + stage('FindHTTPCalls') { + agent { + docker { + image 'maven:3.8.1-adoptopenjdk-11' + } + } + environment { + HTTPCALLS = """${sh( + returnStdout: true, + script: 'find ./sources -path "*.py" -exec grep -H -e "http://" {} \\;' + )}""" + } + steps { + script { + if (env.HTTPCALLS?.trim()) { + currentBuild.result = 'ABORTED' + error("Aborting the build for http calls.") + } + + } + } + } + stage('Build') { agent { docker { diff --git a/sources/add2vals.py b/sources/add2vals.py index 6a50b78..1cab41e 100644 --- a/sources/add2vals.py +++ b/sources/add2vals.py @@ -11,7 +11,7 @@ argnumbers = len(sys.argv) - 1 r =requests.get('https://xkcd.com/1906/') if argnumbers == 2 : - print("") +# print("") print("The result is " + str(calc.add2(str(sys.argv[1]), str(sys.argv[2])))) print("") sys.exit(0)