Merge pull request #2 from MMDelRio/1112

Add FindHTTPCalls stage to Jenkinsfile
This commit is contained in:
MMDelRio 2021-11-30 17:34:48 -04:00 committed by GitHub
commit da8699ba7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

24
Jenkinsfile vendored
View file

@ -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 {

View file

@ -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)