-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://git.itextsupport.com/ * release/1.0.2: [RELEASE] 1.0.2-SNAPSHOT -> 1.0.2 Update port-hash thai_03 test fails in .NET. Might be related to reading UTF-8 files issue Combine HOCR and TXT outputs for more precise text recognition Deprecate unused log message constant Stabilize test on different Tesseract versions Add possibility to set image preprocessing properties Tesseract does not respect image rotation when doing OCR Update port-hash Use tesseract executable from path instead of tesseractDir in tests If path to tessdata contains non ASCII characters, code unexpectedly fails TextInfo: move from List<Float> to Rectangle Use generalized Jenkinsfile in the pipeline-library Deprecate Tesseract4LogMessageConstant#CANNOT_CONVERT_IMAGE_TO_GRAYSCALE Update autoported files Non-Ascii characters support for the output file Use ImageTypeDetector from io module to detect image types Use new SystemUtil#runProcessAndWait overload from 7.1.12-SNAPSHOT accepting working directory Update port-hash Update port-hash after release [RELEASE] Update dependency versions
- Loading branch information
Showing
72 changed files
with
2,227 additions
and
727 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,219 +1,8 @@ | ||
#!/usr/bin/env groovy | ||
@Library('pipeline-library')_ | ||
|
||
def schedule = env.BRANCH_NAME.contains('master') ? '@monthly' : env.BRANCH_NAME == 'develop' ? '@midnight' : '' | ||
def repoName = "pdfOcr" | ||
def dependencyRegex = "itextcore" | ||
def solutionFile = "i7n-ocr.sln" | ||
|
||
pipeline { | ||
|
||
agent { label 'windows' } | ||
|
||
environment { | ||
tesseractDir = tool name: 'Tesseract', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool' | ||
} | ||
|
||
options { | ||
ansiColor('xterm') | ||
buildDiscarder(logRotator(artifactNumToKeepStr: '1')) | ||
parallelsAlwaysFailFast() | ||
retry(1) | ||
skipStagesAfterUnstable() | ||
timeout(time: 60, unit: 'MINUTES') | ||
timestamps() | ||
} | ||
|
||
triggers { | ||
cron(schedule) | ||
} | ||
|
||
stages { | ||
stage('Abort possible previous builds') { | ||
steps { | ||
script { | ||
abortPreviousBuilds() | ||
} | ||
} | ||
} | ||
stage('Wait for blocking jobs') { | ||
steps { | ||
script { | ||
properties[[ | ||
$class : 'BuildBlockerProperty', | ||
blockLevel : 'GLOBAL', | ||
blockingJobs : "^iText_7_Java/itextcore/$env.JOB_BASE_NAME\$", | ||
scanQueueFor : 'ALL', | ||
useBuildBlocker: true | ||
]] | ||
} | ||
} | ||
} | ||
stage('Clean workspace') { | ||
options { | ||
timeout(time: 5, unit: 'MINUTES') | ||
} | ||
steps { | ||
cleanWs deleteDirs: true, patterns: [ | ||
[pattern: 'packages', type: 'INCLUDE'], | ||
[pattern: 'global-packages', type: 'INCLUDE'], | ||
[pattern: 'tmp/NuGetScratch', type: 'INCLUDE'], | ||
[pattern: 'http-cache', type: 'INCLUDE'], | ||
[pattern: 'plugins-cache', type: 'INCLUDE'], | ||
[pattern: '**/obj', type: 'INCLUDE'], | ||
[pattern: '**/bin', type: 'INCLUDE'], | ||
[pattern: '**/*.nupkg', type: 'INCLUDE'] | ||
] | ||
} | ||
} | ||
stage('Compile') { | ||
options { | ||
timeout(time: 20, unit: 'MINUTES') | ||
} | ||
steps { | ||
echo "Tesseract directory is ${tesseractDir}" | ||
|
||
withEnv(["NUGET_PACKAGES=${env.WORKSPACE}/global-packages", | ||
"temp=${env.WORKSPACE}/tmp/NuGetScratch", | ||
"NUGET_HTTP_CACHE_PATH=${env.WORKSPACE}/http-cache", "NUGET_PLUGINS_CACHE_PATH=${env.WORKSPACE}/plugins-cache", "gsExec=${gsExec}", "compareExec=${compareExec}", "tesseractDir=${tesseractDir}"]) { | ||
bat "\"${env.NuGet}\" restore i7n-ocr.sln" | ||
bat "dotnet restore i7n-ocr.sln" | ||
bat "dotnet build i7n-ocr.sln --configuration Release --source ${env.WORKSPACE}/packages" | ||
script { | ||
createPackAllFile(findFiles(glob: '**/*.nuspec')) | ||
load 'packAll.groovy' | ||
} | ||
} | ||
} | ||
} | ||
stage('Run Tests') { | ||
options { | ||
timeout(time: 60, unit: 'MINUTES') | ||
} | ||
steps { | ||
echo "Tesseract directory is ${tesseractDir}" | ||
|
||
withEnv(["NUGET_PACKAGES=${env.WORKSPACE}/global-packages", | ||
"temp=${env.WORKSPACE}/tmp/NuGetScratch", | ||
"NUGET_HTTP_CACHE_PATH=${env.WORKSPACE}/http-cache", "NUGET_PLUGINS_CACHE_PATH=${env.WORKSPACE}/plugins-cache", "gsExec=${gsExec}", "compareExec=${compareExec}", "tesseractDir=${tesseractDir}"]) { | ||
script { | ||
createRunTestDllsFile(findFiles(glob: '**/itext.*.tests.dll')) | ||
load 'runTestDlls.groovy' | ||
} | ||
} | ||
} | ||
} | ||
stage('Artifactory Deploy') { | ||
options { | ||
timeout(time: 5, unit: 'MINUTES') | ||
} | ||
when { | ||
anyOf { | ||
branch "master" | ||
branch "develop" | ||
} | ||
} | ||
steps { | ||
script { | ||
getAndConfigureJFrogCLI() | ||
findFiles(glob: '*.nupkg').each { item -> | ||
upload(item) | ||
} | ||
} | ||
} | ||
} | ||
stage('Branch Artifactory Deploy') { | ||
options { | ||
timeout time: 5, unit: 'MINUTES' | ||
} | ||
when { | ||
not { | ||
anyOf { | ||
branch "master" | ||
branch "develop" | ||
} | ||
} | ||
} | ||
steps { | ||
script { | ||
getAndConfigureJFrogCLI() | ||
if (env.GIT_URL) { | ||
repoName = ("$env.GIT_URL" =~ /(.*\/)(.*)(\.git)/)[0][2] | ||
findFiles(glob: '*.nupkg').each { item -> | ||
sh "./jfrog rt u \"$item.path\" branch-artifacts/$env.BRANCH_NAME/$repoName/dotnet/ --recursive=false --build-name $env.BRANCH_NAME --build-number $env.BUILD_NUMBER --props \"vcs.revision=$env.GIT_COMMIT;repo.name=$repoName\"" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Archive Artifacts') { | ||
options { | ||
timeout(time: 5, unit: 'MINUTES') | ||
} | ||
steps { | ||
archiveArtifacts allowEmptyArchive: true, artifacts: '*.nupkg' | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
echo 'One way or another, I have finished \uD83E\uDD16' | ||
} | ||
success { | ||
echo 'I succeeeded! \u263A' | ||
cleanWs deleteDirs: true | ||
} | ||
unstable { | ||
echo 'I am unstable \uD83D\uDE2E' | ||
} | ||
failure { | ||
echo 'I failed \uD83D\uDCA9' | ||
} | ||
changed { | ||
echo 'Things were different before... \uD83E\uDD14' | ||
} | ||
} | ||
|
||
} | ||
|
||
@NonCPS // has to be NonCPS or the build breaks on the call to .each | ||
def createPackAllFile(list) { | ||
// creates file because the bat command brakes the loop | ||
def cmd = '' | ||
list.each { item -> | ||
if (!item.path.contains("packages")) { | ||
cmd = cmd + "bat '\"${env.NuGet.replace('\\','\\\\')}\" pack \"${item.path.replace('\\','\\\\')}\"'\n" | ||
} | ||
} | ||
writeFile file: 'packAll.groovy', text: cmd | ||
} | ||
|
||
@NonCPS // has to be NonCPS or the build breaks on the call to .each | ||
def createRunTestDllsFile(list) { | ||
// creates file because the bat command brakes the loop | ||
def ws = "${env.WORKSPACE.replace('\\','\\\\')}" | ||
def nunit = "${env.'Nunit3-console'.replace('\\','\\\\')}" | ||
def cmd = '' | ||
list.each { item -> | ||
if (!item.path.contains("netcoreapp1.0") && !item.path.contains("obj")) { | ||
cmd = cmd + "bat '\"${nunit}\" \"${ws}\\\\${item.path.replace('\\','\\\\')}\" --result=${item.name}-TestResult.xml'\n" | ||
} | ||
} | ||
writeFile file: 'runTestDlls.groovy', text: cmd | ||
} | ||
|
||
@NonCPS // has to be NonCPS or the build breaks on the call to .each | ||
def createRunTestCsProjsFile(list) { | ||
// creates file because the bat command brakes the loop | ||
def ws = "${env.WORKSPACE.replace('\\','\\\\')}" | ||
def cmd = '' | ||
list.each { item -> | ||
cmd = cmd + "bat 'dotnet test ${ws}\\\\${item.path.replace('\\','\\\\')} --configuration Release --no-build --logger \"trx;LogFileName=results.trx\"'\n" | ||
} | ||
writeFile file: 'runTestCsProjs.groovy', text: cmd | ||
} | ||
|
||
@NonCPS | ||
def upload(item) { | ||
def itemArray = (item =~ /(.*?)(\.[0-9]*\.[0-9]*\.[0-9]*(-SNAPSHOT)?\.nupkg)/) | ||
def dir = itemArray[ 0 ][ 1 ] | ||
sh "./jfrog rt u \"${item.path}\" nuget/${dir}/ --flat=false --build-name="${env.BRANCH_NAME}" --build-number=${env.BUILD_NUMBER}" | ||
} | ||
automaticDotnetBuild(repoName, dependencyRegex, solutionFile) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file added
BIN
+61.5 KB
...sts/itext.pdfocr.api.tests/resources/itext/pdfocr/images/90_degrees_rotated.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.