diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d151177 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,12 @@ +env.dockerimagename="devopsbasservice/buildonframework:buildonJenkinsfile2.0" +node { + stage ('StudentProject_Build') { + checkout scm + sh 'mvn clean package -DskipTests=True' + } + stage ('StudentProject_CodeAnalysis') { + sh 'mvn sonar:sonar -Dsonar.host.url=http://10.0.0.94:9000 -Dmaven.test.failure.ignore=true -DskipTests=true -Dsonar.sources=src/main/java' + sh 'pwd;ls -la ;gate=`./sonar.sh`; if [[ $gate = *OK* ]];then echo OK;else exit 1; fi;' + } + //Test Buildon Test github +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..2077427 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Webhook Testing 1..2..3..4..5 +Private email outlook config changes +Demo commit diff --git a/sonar.sh b/sonar.sh new file mode 100755 index 0000000..1690dbe --- /dev/null +++ b/sonar.sh @@ -0,0 +1,9 @@ +curl -s -u admin:admin -X GET http://10.0.0.94:9000/api/qualitygates/project_status?projectKey=com.github.elizabetht:StudentEnrollmentWithSpring -o gate.json +gate=`grep -oP '\"status\"\:[^,]+' gate.json | head -1` +#echo "Quality Gate " $gate +if [[ $gate = *OK* ]] +then +echo "OK" +else +echo "ERROR" +fi