Skript works from CMD but not from CI tool (Jenkins)

This script is called from a BAT file. If I execute the BAT manually from CMD, everything works as expected.

If I execute the BAT through Jenkins it stops after pretranslating = doesn't update the translator files (*tbulic).

Any clues how to debug this?

Greetings,

Franz-Josef

Script:

;;;
;;; Open Project exclusive mode
;;;

/openproject:INFRASIGN_L10N.lpu normal

;;;
;;; Add new files - DLL, EXE
;;;

/addsource:CAD_PROG\*.dll
/addsource:CAD_PROG\*.exe

;;;
;;; Update from nightly build
;;; if required
;;;

/update ifrequired

;;;
;;; Import translations
;;;

/runmacro=InfrasignImportB8.bas

;;;
;;; Pretranslate with DeepL
;;;

/translate lang:Dutch
/translate lang:English
/translate lang:Spanish

;;;
;;; Export translations
;;;

/runmacro=InfrasignExportB8.bas

;;;
;;; Generate
;;; if required
;;;

/generate ifrequired

;;;
;;; Close project
;;;

/closeproject

Basic Export snippet:

''Exports translations in one TBULIC per lang.
Sub main
  Dim prj As PslProject
  Set prj = PSL.ActiveProject
  If prj Is Nothing Then Exit Sub
 
  Dim lang As PslLanguage
  For Each lang In prj.Languages
    ' Create the translation bundle
    Dim bundle As PslTransBundle
    Set bundle = prj.PrepareTransBundle
 
    Dim trn As PslTransList
    dim i as Integer
    For i = 1 to prj.TransLists.Count
      set trn = prj.TransLists(i)
      If trn.Language Is lang Then
        bundle.AddTransList(trn)
      End If
    Next i
   
    ' Add glossaries
    ' bundle.AddGlossary("c:\Glossaries\myglossary.glo")
    ' bundle.AddGlossary(PSL.Glossaries(1))
 
    ' AddMacro
      bundle.AddMacro("PslCheckCPP.bas")
 
    ' Make filename "test_<langcode>.tba/tbu"
    Dim filename As String
    filename = "F:\jenkins\jobs\l10n-infrasign-b8\workspace\INFRASIGN_L10N_" &  PSL.GetLangCode(lang.LangID, pslCode639_1)

    bundle.License ("")
    prj.ExportTransBundle bundle, filename
  Next lang
End Sub

  • Hi Franz-Josef,

    Does your Jenkins server run as the same user account as your batch job?

    How is the "F:" drive setup? Is it a network share or subst? It could be that when running in Jenkins, this drive is not available? 

    If you inserted this command into your Jenkins job before you start your batch job:

    wmic logicaldisk get name

    You can see if the F: drive is there whilst running in Jenkins. If the drive is not showing in Jenkins, you can add the commands in Jenkins to ensure it is available before running your job.

    Good luck 

    Mark

    emoji
  • Hi Mark,

    thank you for your suggestions. F: is a local drive and it is and was available. The problem of the script probably was the status of the project, files not correctly marked as exported, not released after import...

    Anyway, cleaning the project and restarting helped and now Jenkins does what he is expected to do :-).

    Greetings,
    Franz-Josef

    emoji