Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
circle

GitHub Action

Setup Jenkins

v0.3.0

Setup Jenkins

circle

Setup Jenkins

Set up Jenkins container

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Jenkins

uses: snow-actions/[email protected]

Learn more about this action in snow-actions/setup-jenkins

Choose a version

Test

Setup Jenkins

Set up Jenkins container (PoC). A few features are available.

Usage

  1. Copy $JENKINS_HOME/jobs/*/config.xml from existing Jenkins to jenkins_home/ in a repository
  2. You can put jenkins_home/jenkins.yaml if Jenkins Configuration as Code (optional)
  3. Create a workflow with the jenkins_home path
steps:
  - uses: actions/checkout@v3
  - uses: snow-actions/[email protected]
    with:
      jenkins_home: jenkins_home
  - run: wget $JENKINS_URL/jnlpJars/jenkins-cli.jar
  - run: java -jar jenkins-cli.jar -webSocket help
  - run: java -jar jenkins-cli.jar -webSocket build job-1 -f -v -p param_1=p1

Inputs

See action.yml

Name Description Default Required
jenkins_home Jenkins home path
which will be mounted to /var/jenkins_home.
Set '' if you don't want to mount.
${{ runner.temp }}/jenkins_home no
jenkins_image_tag Jenkins image tag lts-jdk11 no

Output environment variables

Name Description
JENKINS_HOME Path to jenkins_home
JENKINS_VERSION Jenkins version
JENKINS_URL Jenkins URL: http://localhost:8080
COMPOSE_FILE Docker Compose variable as same as --file, -f option
You can access Jenkins container by docker compose exec jenkins <command>

Examples

See test.yml

Supported

Runners

  • ubuntu-20.04
  • ubuntu-18.04
  • self-hosted

Events

  • Any

Dependencies

Contributing

Welcome.