### Start a Maven-specific setup Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2024/10/25/2024-10-25-jenkins-tutorial-revamp.adoc Example command to start a Maven-specific setup using Docker Compose profiles. ```bash docker compose --profile maven up -d ``` -------------------------------- ### Simple Pipeline Example Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/pipeline/getting-started-pipelines.adoc An example of a successful build of a pipeline created with a one-line script using the 'echo' step. ```Groovy Started by user anonymous [Pipeline] echo hello from Pipeline [Pipeline] End of Pipeline Finished: SUCCESS ``` -------------------------------- ### Docker Compose Up Command Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/projects/gsoc/2023/project-ideas/docker-compose-build.adoc This command starts a Jenkins instance using Docker Compose. ```bash docker-compose up ``` -------------------------------- ### Quick Start - Initial Termux Setup Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2025/10/31/2025-10-31-automating-jenkins-on-android.adoc Commands to install necessary packages and start SSH on an Android device within Termux. ```bash # On the Android device (in Termux) pkg install openssh python sshd passwd whoami ifconfig wlan0 ``` -------------------------------- ### Basic Groovy Syntax for Pipeline Configuration (Unix-like) Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/pipeline/getting-started-pipelines.adoc Example of a basic pipeline script for Unix-like operating systems using Git and Maven. ```groovy node { git url: 'https://github.com/joe_user/simple-maven-project-with-tests.git' def mvnHome = tool 'M3' sh "${mvnHome}/bin/mvn -B verify" } ``` -------------------------------- ### Setup and Build Commands Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2020/06/2020-06-30-machine-learning-plugin-coding-phase1.adoc Commands to set up the development environment, clone the repository, and build the plugin. ```bash mkdir machine-learning-plugin cd machine-learning-plugin virtualenv venv source venv/bin/activate which python git clone https://github.com/jenkinsci/machine-learning-plugin.git cd machine-learning-plugin mvn clean install mvn hpi:run ``` -------------------------------- ### Run Jenkins Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/pipeline/tour/getting-started.adoc Command to run Jenkins locally on port 8080. ```bash java -jar jenkins.war --httpPort=8080 ``` -------------------------------- ### Old Maven Tutorial Docker Setup Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2024/10/25/2024-10-25-jenkins-tutorial-revamp.adoc A snippet from the old Maven tutorial illustrating the complex Docker setup process that was overwhelming for beginners and lacked context. ```bash docker network create jenkins docker run \ --name jenkins-docker \ --rm \ --detach \ --privileged \ --network jenkins \ --network-alias docker \ --env DOCKER_TLS_CERTDIR=/certs \ --volume jenkins-docker-certs:/certs/client \ --volume jenkins-data:/var/jenkins_home \ --publish 2376:2376 \ docker:dind \ --storage-driver overlay2 ``` -------------------------------- ### Create a quickstart application Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2018/04/2018-04-10-opinionated-cd-jenkins-x.adoc This command allows users to create applications from a set of pre-defined starter templates (quickstarts). ```bash > jx create quickstart ``` -------------------------------- ### README.md Hello World Build Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2013/2013-09-23-literate-builds-wtf.adoc A README.md example for building a hello world project. ```bash echo hello world ``` -------------------------------- ### Git Step with Named Parameters Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/pipeline/getting-started-pipelines.adoc Example of using the git step with named parameters for URL and branch. ```groovy git([url: 'https://github.com/joe_user/simple-maven-project-with-tests.git', branch: 'master']) ``` -------------------------------- ### Quick Start - Laptop Setup and Execution Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2025/10/31/2025-10-31-automating-jenkins-on-android.adoc Commands to clone the automation repository, run the setup script, and access Jenkins. ```bash # On your laptop/PC git clone https://github.com/gounthar/termux-jenkins-automation.git cd termux-jenkins-automation ./scripts/run-setup.sh # Answer prompts: # - IP address (from ifconfig) # - SSH port (8022 default) # - Username (from whoami) # - Jenkins admin password # - Authentication method (SSH key recommended) # Wait ~15 minutes # Access Jenkins: ``` -------------------------------- ### Add app command examples Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/projects/gsoc/2020/projects/jenkins-x-apps-consolidation.adoc Examples of adding applications using the new command structure. ```bash jx add app jx-app-kubeless jx add app jx-app-gloo jx add app jx-app-flagger jx add app jx-app-ingress jx add app jx-app-prometheus jx add app jx-app-anchore jx add app jx-app-ambassador jx add app jx-app-gitea ``` -------------------------------- ### Minimal Jenkins Installation and Plugin Manager Setup Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/views/table-to-div-migration.adoc This bash script demonstrates how to set up a minimal Jenkins installation for debugging the table to div migration, including fetching plugins and starting Jenkins. ```bash JENKINS_HOST=username:password@myhost.com:port curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?([\w-]+).*?([^<]+)()(<\/\w+>)+/\1 \2\n/g'| sed 's/ /:/' | cut -d ':' -f 1 | sort > plugins.txt wget https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.9.0/jenkins-plugin-manager-2.9.0.jar wget https://get.jenkins.io/war-stable/2.277.1/jenkins.war export JENKINS_HOME=~/.jenkins-tables-to-div java -jar jenkins-plugin-manager-2.9.0.jar -f plugins.txt -d $JENKINS_HOME/plugins --war jenkins.war java -jar jenkins.war ``` -------------------------------- ### Managing PATH Environment Variable Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/pipeline/getting-started-pipelines.adoc Example of adding a tool's bin directory to the PATH environment variable for subsequent steps. ```groovy node { git url: 'https://github.com/joe_user/simple-maven-project-with-tests.git' def mvnHome = tool 'M3' env.PATH = "${mvnHome}/bin:${env.PATH}" sh 'mvn -B verify' } ``` -------------------------------- ### Install pre-commit hooks Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2026/06/2026-06-08-jenkinsfilelint-pre-commit.adoc Install the pre-commit framework and initialize the hooks in your repository. ```bash pip install pre-commit pre-commit install ``` -------------------------------- ### Jenkins service status during startup Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2022/03/2022-03-25-systemd-migration.adoc Example output of `systemctl status jenkins` as the Jenkins service is starting up. ```bash systemctl status jenkins ● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jenkins.service.d └─override.conf Active: activating (start) since […] Main PID: […] (java) ---- ``` -------------------------------- ### Clone the repository Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2024/10/25/2024-10-25-jenkins-tutorial-revamp.adoc Command to clone the quickstart-tutorials repository. ```bash git clone https://github.com/jenkins-docs/quickstart-tutorials.git ``` -------------------------------- ### Run the example Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/tutorials/build-a-multibranch-pipeline-project.adoc Execute the command to run the example. ```bash docker compose --profile multi up -d ``` -------------------------------- ### Basic Groovy Syntax for Pipeline Configuration (Windows) Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/pipeline/getting-started-pipelines.adoc Example of a basic pipeline script for Windows environments, demonstrating the use of 'bat' and escaped backslashes. ```groovy bat "${mvnHome}\\bin\\mvn -B verify" ``` -------------------------------- ### Helm Chart Output Example Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2019/08/2019-08-19-remoting-kafka-kubernetes-release-2.0.adoc Example output of 'kubectl get all' after installing the Remoting over Apache Kafka plugin using the Helm chart, showing the status of pods, services, deployments, and stateful sets. ```bash NAME READY STATUS RESTARTS AGE pod/demo-jenkins-64dbd87987-bmndf 1/1 Running 0 2m21s pod/demo-kafka-0 1/1 Running 0 2m21s pod/demo-zookeeper-0 1/1 Running 0 2m21s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/demo-jenkins NodePort 10.108.238.56 8080:30386/TCP 2m21s service/demo-jenkins-agent ClusterIP 10.98.85.184 50000/TCP 2m21s service/demo-kafka ClusterIP 10.109.231.58 9092/TCP 2m21s service/demo-kafka-headless ClusterIP None 9092/TCP 2m21s service/demo-zookeeper ClusterIP 10.103.2.231 2181/TCP 2m21s service/demo-zookeeper-headless ClusterIP None 2181/TCP,3888/TCP,2888/TCP 2m21s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/demo-jenkins 1/1 1 1 2m21s NAME DESIRED CURRENT READY AGE replicaset.apps/demo-jenkins-64dbd87987 1 1 1 2m21s NAME READY AGE statefulset.apps/demo-kafka 1/1 2m21s statefulset.apps/demo-zookeeper 1/1 2m21s ``` -------------------------------- ### Example build step output Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/tutorial/run.adoc This is an example of the console output from a build step that adds a greeting. ```text Started by user anonymous Building in workspace /Users/mrjenkins/demo/work/workspace/testjob Hello, Jenkins! // <1> Finished: SUCCESS <1> The Greeting added by the build step ``` -------------------------------- ### Simple Hello World Build Source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/blog/2013/2013-09-23-literate-builds-wtf.adoc A basic example of a build command to print 'Hello world'. ```bash echo -n "Hello" ``` ```bash echo " world" ```