Jenkins Pipeline Introduction, Installation, and Creation Methods
This article provides a step‑by‑step guide on installing Jenkins Blue Ocean via Docker, creating pipelines using both the classic UI and the Blue Ocean visual plugin, and configuring pipeline stages, triggers, and environment variables with example Groovy scripts.
This article records the process of using Jenkins to build a pipeline for a business team, focusing on installation, configuration, and two ways to create pipelines. All code shown is pseudo‑code for confidentiality.
Jenkins Blue Ocean Installation (Docker)
1. Pull the Jenkins Blue Ocean image: docker pull jenkinsci/blueocean 2. Create a host directory for Jenkins data: mkdir /var/jenkins_home 3. Run the container:
docker run -d -p 8888:8080 -p 50000:50000 -v jenkins:/var/jenkins_home -v /etc/localtime:/etc/localtime --name jenkinsci-blueocean jenkinsci/blueoceanAfter logging in, the Blue Ocean icon appears in the left navigation. If using the standard Jenkins, install the Blue Ocean plugin via Manage Jenkins → Manage Plugins .
Classic Mode Pipeline Creation
1. Click New Item on the Jenkins home page and select Pipeline . 2. Fill in the job name and description, then confirm. 3. In the pipeline configuration page, four tabs are presented: General, Build Triggers, Advanced Project Options, and Pipeline.
Key settings include:
General : basic job information.
Build Triggers : e.g., poll SCM for GitLab updates.
Advanced Project Options : optional display name.
Pipeline : define the pipeline script using Groovy or reference a Jenkinsfile in SCM.
The article shows a sample Declarative Pipeline script with stages Build , Docker Build , Deploy , and Test , illustrating steps such as checking out code, building Docker images, archiving artifacts, and running shell commands. Environment variables are also defined for image name, project path, Kubernetes config, and Git tag.
Artifacts generated during the pipeline (e.g., APKs, Docker images) should be archived to allow download from the Jenkins UI.
Using the Blue Ocean Plugin
The Blue Ocean plugin provides a visual interface for creating pipelines without writing code. After clicking Open Blue Ocean on the Jenkins home page, you can create a new pipeline, select a repository, provide credentials, and add stages and steps through a wizard‑like UI. The plugin automatically generates a Jenkinsfile and stores it in the repository, updating it on each change.
Both methods have trade‑offs: classic mode offers full control but requires Groovy knowledge; Blue Ocean is beginner‑friendly but may become cumbersome for many projects or complex pipelines.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
