Merge pull request #2 from MMDelRio/1112
Add FindHTTPCalls stage to Jenkinsfile
This commit is contained in:
commit
da8699ba7e
2 changed files with 25 additions and 1 deletions
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
|
@ -1,6 +1,30 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none
|
||||||
stages {
|
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') {
|
stage('Build') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
|
|
|
@ -11,7 +11,7 @@ argnumbers = len(sys.argv) - 1
|
||||||
r =requests.get('https://xkcd.com/1906/')
|
r =requests.get('https://xkcd.com/1906/')
|
||||||
|
|
||||||
if argnumbers == 2 :
|
if argnumbers == 2 :
|
||||||
print("")
|
# print("")
|
||||||
print("The result is " + str(calc.add2(str(sys.argv[1]), str(sys.argv[2]))))
|
print("The result is " + str(calc.add2(str(sys.argv[1]), str(sys.argv[2]))))
|
||||||
print("")
|
print("")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue