Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 7.7.1

...

Code SnippetDescription
agent {
    node {
        label 'Windows'
        customWorkspace "workspace/test-xUML-project"
    }
}

Section agent defines

  • the name of the agent that should execute the build
  • the common workspace directory on this agent for all branches within the Git repository. If not specified, Jenkins will create a separate workspace for every branch.
options {
    buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '1'))
    disableConcurrentBuilds()
}


Section options defines

  • the count of build logs to keep
  • the count of build artifacts to keep
  • whether concurrent builds are allowed
parameters {
    choice(name: 'E2EC', choices: 'D:/jenkins/userContent/e2ec/e2ec-7.0.0-beta1.jar', description: 'Location of the E2E Compiler')
    choice(name: 'REGTEST', choices: 'D:/jenkins/userContent/RegTestRunner/RegTestRunner-nightly.jar', description: 'Location of the E2E Regression Test Runner')
}


Section parameters defines parameters to use further below in the script. If you provide multiple choices, Jenkins will generate a dropdown list do to select from. The first list item serves as the default value. This default will be selected, if the script is triggered automatically.

Note
iconfalse

A build with newly added parameters will always fail for the first time, because Jenkins needs the first run to add the parameters to the pipeline configuration.

stages {
    stage('Build') { 
        [...]
    }
}


In section stages, you can define named build stages. If the processing of one stage fails, the subsequent stages will not be processed.
steps {
    dir('Advanced Modeling/E2ELibrary') {
    bat """
        java -jar ${E2EC} -uml uml/librarySQLQuery.xml
        copy repository\\librarySQLQuery\\librarySQLQuery.lrep libs\\
        java -jar ${E2EC} -uml uml/useLibrarySQLQuery.xml
    """
    archiveArtifacts artifacts: 'repository/useLibrarySQLQuery/UseE2ELibraryExample.rep'
} 


 In section steps, you can define the tasks to process in this stage, e.g.

  • dir: to change the active directory within the Git repository
  • bat: to execute batch commands (Windows), e.g.
    1. Call the library build.
    2. Copy the library repository to the libs folder.
    3. Call the xUML model build.

    Wrap the batch commands in

    • single quotes ('), if Jenkins variables should not be resolved within the batch command
    • double quotes ("), if Jenkins variables should be resolved within the batch command
    • triple single quotes (''') or triple double quotes (""") for multiple line batch scripts
  • archiveArtifacts: to define a list of artifacts (outputs) of this job. These artifacts can be downloaded via the Jenkins console.
java -jar ${E2EC} -uml uml/librarySQLQuery.xml


Call the E2E Command Line Compiler. The location of the compiler is specified via a Jenkins parameter (see above).
copy repository\\librarySQLQuery\\librarySQLQuery.lrep libs\\


Copy the compiled library repository to the libs folder of the project, so it will be used when compiling the usage model. For more details, see Compiling Libraries and Library Usage Models.
e2ebridge deploy E2ELibrary/repository/useLibrarySQLQuery/UseE2ELibraryExample.rep -h <Bridge host> -u <user> -P <password> -o overwrite


Call the E2E Bridge CLI to deploy the compiled service to an E2E Bridge.
dir('Advanced Modeling') {
    bat """
        java -jar ${REGTEST} -project PState -suite "QA Tests/Tests" -logfile result.xml -host <Bridge host> -port <port> -username <user> -password <password>
    """
}
Call the E2E RegTestRunner to perform regression tests on the newly deployed service. The location of the RegTestRunner is specified via a Jenkins parameter (see above).

...