UNCLASSIFIED

README.md 6.79 KB
Newer Older
1
# jenkinsfile-runner 1.0-beta-27
Al Fontaine's avatar
Al Fontaine committed
2

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
## Introduction

Jenkinsfile-Runner is a slimmed version of Jenkins, utilizing the Jenkins pipeline execution engine a CLI tool. For more information on the open source project, please visit https://github.com/jenkinsci/jenkinsfile-runner

## SDP

To learn more about the Solutions Delivery Platform please visit https://boozallen.github.io/sdp-docs/overview/1/index.html

## Notes

Recommended resources for the image:

  - Min cpu - 1 vCpu
  - Min memory - 1 GB
  - Storage min - 1 GB. To persist data, volumes can be mounted various folders outlined in the Dockerfile. Storage requirements will vary based on the amount of builds you wish to keep.

To run the container, you will need to volume mount a directory containing at least a Jenkinsfile for the container. By default, the container will look for the Jenkinsfile at /workspace in the container.
An example of running the container:
```
podman run -it -v$(pwd):/workspace jenkins/jenkinsfile-runner:latest
```

 - To display the help screen, issue --help in the command section after calling the container: "docker run -it -v $(pwd):/workspace jenkins/jenkinsfile-runner:latest --help"
 - To avoid using the jenkinfile-runner-launcher script, which is an opinionated helper script, use option "--entrypoint /app/bin/jenkinsfile-runner"
 - If not using jenkinsfile-runner-launcher, you will have to specify the jenkinsfile (-f) and the war (-w) or jenkins version (-jv) to use
 - Location of the Jenkins WAR: /app/jenkins
 - Using the JTE option, you will need to provide the location of the pipeline_config file (-p) and in the casc file provide the location of JTE libraries

Example CASC Definition:

unclassified:
  templateGlobalConfig:
    tier:
      configurationProvider: "null"
      librarySources:
      - libraryProvider:
          scm:
            baseDir: "libraries" #<- the relative path to the libraries folder in the git repo
            scm:
              git:
                branches:
                - name: "*/master"
                buildChooser: "default"
                userRemoteConfigs:
                - url: "file:///workspace" #<- the root directory of the git repo volume mounted to the container

Help Screen Output:
```
Usage: jenkinsfile-runner [-huV] [-jte] [-ns] [--skipShutdown]
                          [-b=<buildNumber>] [-c=<cause>] [-f=<jenkinsfile>]
                          [-jv=<version>] [--libPath=<libPath>] [-m=<mirror>]
                          [-n=<jobName>] [-p=<pluginsDir>]
                          [-pc=<pipelineConfiguration>]
                          [--runHome=<jenkinsHome>]
                          [--runWorkspace=<runWorkspace>] [--scm=<scm>]
                          [-w=<warDir>] [--withInitHooks=<withInitHooks>]
                          [-a=<String=String>]... [COMMAND]
  -f, --file=<jenkinsfile>   Path to Jenkinsfile or directory containing a
                               Jenkinsfile, defaults to ./Jenkinsfile
      --runWorkspace=<runWorkspace>
                             Path to the workspace of the run to be used within
                               the node{} context. It applies to both Jenkins
                               master and agents (or side containers) if any.
                               Requires Jenkins 2.119 or above
  -n, --job-name=<jobName>   Name of the job the run belongs to
  -c, --cause=<cause>        Cause of the run
  -b, --build-number=<buildNumber>
                             Build number of the run
  -a, --arg=<String=String>  Parameters to be passed to the build. Use multiple
                               -a switches for multiple params
      -ns, --no-sandbox      Disable workflow job execution within sandbox
                               environment
  -u, --keep-undefined-parameters
                             Keep undefined parameters if set
      --scm=<scm>            YAML definition of the SCM, with optional
                               credentials, to use for the project
      -jte, --jenkins-templating-engine
                             Use the Jenkins Templating Engine for the build
      -pc, --pipeline-configuration=<pipelineConfiguration>
                             The Pipeline Configuration File when using the
                               Jenkins Templating Engine
  -w, --jenkins-war=<warDir> Path to exploded jenkins war directory.Depending
                               on packaging, it may contain the entire WAR or
                               just resources to be loaded by the WAR file, for
                               example Groovy hooks or extra libraries.
  -p, --plugins=<pluginsDir> Plugins required to run pipeline. Either a plugins.
                               txt file or a /plugins installation directory.
                               Defaults to plugins.txt
      -jv, --jenkins-version=<version>
                             Jenkins version to use if Jenkins WAR is not
                               specified by --jenkins-war. Defaults to the
                               latest LTS
  -m, --mirror=<mirror>      Download mirror site of Jenkins, defaults to http:
                               //updates.jenkins.io/download. Get the mirror
                               list from http://mirrors.jenkins-ci.org/status.
                               html
      --runHome, --jenkinsHome=<jenkinsHome>
                             Path to the empty Jenkins Home directory to use
                               for this run. If not specified a temporary
                               directory will be created. Note that the
                               specified folder will not be disposed after the
                               run
      --withInitHooks=<withInitHooks>
                             Path to a directory containing Groovy Init Hooks
                               to copy into init.groovy.d
      --skipShutdown         Forces Jenkinsfile Runner to skip the shutdown
                               logic. It reduces the instance termination time
                               but may lead to unexpected behavior in plugins
                               which release external resources on clean up
                               synchronous task queues on shutdown.
      --libPath=<libPath>    When a slim packaging is used, points to the
                               library directory which contains payload.jar and
                               setup.jar files
  -h, --help                 Show this help message and exit.
  -V, --version              Print version information and exit.
Commands:
  run                  Runs Jenkinsfile
  cli                  Runs interactive Jenkins CLI
  generate-completion  Generate bash/zsh completion script for
                         jenkinsfile-runner.
  version              Shows Jenkinsfile Runner version
  help                 Displays help information about the specified command
```