-
Notifications
You must be signed in to change notification settings - Fork 23
Pipeline + Build + Sonar + Unit tests #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PeggyCole
wants to merge
1
commit into
develop
Choose a base branch
from
develop01
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| pipeline { | ||
| agent { label 'Node01' } | ||
| options { | ||
| buildDiscarder(logRotator(numToKeepStr:'5')) | ||
| timeout(time: 10, unit: 'MINUTES') | ||
| skipDefaultCheckout() | ||
| } | ||
| stages { | ||
| stage ('Build') { | ||
| steps { | ||
| checkout([ $class: 'GitSCM', branches: scm.branches, extensions: scm.extensions + [[$class: 'CleanCheckout']], userRemoteConfigs: scm.userRemoteConfigs ]) | ||
| withEnv(["DLC=${tool name: 'OpenEdge-12.1', type: 'openedge'}", "JAVA_HOME=${tool name: 'JDK8', type: 'jdk'}"]) { | ||
| bat "%DLC%\\ant\\bin\\ant -DDLC=%DLC% -lib %DLC%\\pct\\pct.jar build test dist" | ||
| } | ||
| junit 'results.xml' | ||
| stash name: 'windows-build', includes: 'target/DataDigger.zip' | ||
| archiveArtifacts artifacts: 'target/DataDigger.zip' | ||
| } | ||
| } | ||
|
|
||
| stage ('Code analysis') { | ||
| steps { | ||
| script { | ||
| withEnv(["PATH+SCAN=${tool name: 'SQScanner4', type: 'hudson.plugins.sonar.SonarRunnerInstallation'}/bin", "DLC=${tool name: 'OpenEdge-12.1', type: 'openedge'}"]) { | ||
| withSonarQubeEnv('RSSW') { | ||
| if (("master" == env.BRANCH_NAME) || ("develop" == env.BRANCH_NAME) || ("develop02" == env.BRANCH_NAME)) { | ||
| bat "sonar-scanner -Dsonar.oe.dlc=%DLC% -Dsonar.branch.name=%BRANCH_NAME%" | ||
| } else { | ||
| bat "sonar-scanner -Dsonar.oe.dlc=%DLC% -Dsonar.branch.name=%BRANCH_NAME% -Dsonar.branch.target=develop02" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
|
|
||
| <!-- How to execute : %DLC%\ant\bin\ant -lib %DLC%\pct\PCT.jar -DDLC=%DLC% clean build --> | ||
| <project name="DataDigger" > | ||
| <taskdef resource="PCT.properties" /> | ||
| <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" /> | ||
|
|
||
| <target name="clean"> | ||
| <delete dir="target" /> | ||
| </target> | ||
|
|
||
| <target name="init"> | ||
| <mkdir dir="target/build" /> | ||
| <mkdir dir="target/db" /> | ||
| <PCTVersion /> | ||
| <ProgressVersion dlcHome="${DLC}" fullVersion="dlc.version.full" /> | ||
| <echo message="${dlc.version.full}" /> | ||
| <sports2000 destDir="target/db" dlcHome="${DLC}" /> | ||
| </target> | ||
|
|
||
| <target name="build" depends="init"> | ||
| <PCTCompile destdir="target/build" graphicalMode="true" dlcHome="${DLC}" cpinternal="utf-8" cpstream="utf-8" listing="true" relativePaths="true" xmlXref="true" keepXref="true" requireFullKeywords="false" requireFullNames="true" requireFieldQualifiers="true"> | ||
| <fileset dir="." includes="*.p,*.w,*.cls" /> | ||
| <DbConnection dbDir="target/db" dbName="sports2000" readOnly="true" /> | ||
| <propath> | ||
| <pathelement location="." /> | ||
| </propath> | ||
| </PCTCompile> | ||
| </target> | ||
|
|
||
| <target name="test"> | ||
| <mkdir dir="profiler" /> | ||
| <ABLUnit dlcHome="${DLC}"> | ||
| <fileset dir="." includes="test/*.p" /> | ||
| <DbConnection dbDir="target/db" dbName="sports2000" readOnly="true" /> | ||
| <Profiler enabled="true" coverage="true" outputDir="profiler" /> | ||
| <propath> | ||
| <pathelement path="." /> | ||
| </propath> | ||
| </ABLUnit> | ||
| <xmltask source="results.xml" dest="sonar.xml"> | ||
| <rename path="//testsuites" to="testExecutions" /> | ||
| <attr path="//testExecutions" attr="version" value="1" /> | ||
| <rename path="//testsuite" to="file" /> | ||
| <rename path="//file/@name" to="path" /> | ||
| <rename path="//testcase" to="testCase" /> | ||
| <remove path="//testCase/@time" /> | ||
| <attr path="//testCase" attr="duration" value="0" /> | ||
| </xmltask> | ||
| </target> | ||
|
|
||
| <target name="dist"> | ||
| <zip destFile="target/DataDigger.zip"> | ||
| <fileset dir="target/build" includes="*.r" /> | ||
| <fileset dir="." includes="*.wrx" /> | ||
| <fileset dir="." includes="*.bat,*.ini,*.txt,image/*" /> | ||
| </zip> | ||
| <touch file="empty_schema.df" /> | ||
| </target> | ||
|
|
||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| sonar.projectKey=patrickTingen:DataDigger | ||
| sonar.projectName=DataDigger | ||
| sonar.projectVersion=1.0 | ||
| sonar.projectDescription=DataDigger | ||
| sonar.sources=. | ||
| sonar.sourceEncoding=utf-8 | ||
| sonar.inclusions=*.i,*.p,*.w,*.cls | ||
| sonar.tests=test | ||
| sonar.oe.binaries=target/build | ||
| sonar.oe.propath=. | ||
| sonar.oe.propath.dlc=true | ||
| sonar.oe.databases=empty_schema.df:dictdb | ||
| sonar.oe.coverage.profiler.dirs=profiler | ||
| sonar.testExecutionReportPaths=sonar.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ROUTINE-LEVEL ON ERROR UNDO, THROW. | ||
|
|
||
| USING OpenEdge.Core.Assert. | ||
|
|
||
| { DataDigger.i } | ||
|
|
||
| @Test. | ||
| PROCEDURE TestCreateFolder: | ||
| DEFINE VARIABLE lib AS HANDLE NO-UNDO. | ||
| RUN dataDiggerLib.p PERSISTENT SET lib. | ||
| RUN getTables IN lib (INPUT TABLE ttTableFilter, OUTPUT TABLE ttTable). | ||
|
|
||
| DEFINE VARIABLE cErr AS CHARACTER NO-UNDO. | ||
| RUN createFolder IN lib (INPUT '.\dir1\dir2\dir3'). | ||
|
|
||
| FILE-INFO:FILE-NAME = "dir1". | ||
| Assert:IsTrue(INDEX(FILE-INFO:FILE-TYPE, "D") GT 0). | ||
| FILE-INFO:FILE-NAME = "dir1/dir2". | ||
| Assert:IsTrue(INDEX(FILE-INFO:FILE-TYPE, "D") GT 0). | ||
| FILE-INFO:FILE-NAME = "dir1/dir2/dirss3". | ||
| Assert:IsTrue(INDEX(FILE-INFO:FILE-TYPE, "D") GT 0). | ||
|
|
||
| DELETE PROCEDURE lib. | ||
|
|
||
| END PROCEDURE. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add something more