You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Setup Jenkins
v1.0.0
Set up Jenkins container.
- Copy
$JENKINS_HOME/jobs/*/config.xml
from existing Jenkins tojenkins_home/
in your repository
or you can putjenkins_home/jenkins.yaml
if Jenkins Configuration as Code (JCasC) - 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
See action.yml
Name | Description | Default | Required |
---|---|---|---|
jenkins_image_tag |
Jenkins image tag | lts-jdk11 |
no |
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 |
env_file |
Jenkins container env_file path | - | no |
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 optionYou can access Jenkins container by docker compose exec jenkins <command> |
See test.yml
See jenkins.yaml
Documents
- https://www.jenkins.io/doc/book/managing/casc/
- https://www.jenkins.io/projects/jcasc/
- https://plugins.jenkins.io/configuration-as-code/
- https://plugins.jenkins.io/configuration-as-code-groovy/
- https://plugins.jenkins.io/job-dsl/
ubuntu-20.04
ubuntu-18.04
self-hosted
- Any
Welcome.