# PHASE 1: ## Week 1 : Set Up ### Objective Stabilize the Jenkins Tekton Client Plugin by ensuring it builds successfully and runs in Jenkins ### Environment | Tool | Version |---------|--------- | Java | 11 (Temurin-11 via `/usr/libexec/java_home -v11`) | Maven | 3.9.9 | Jenkins | 2.479.3 (via `mvn hpi:run`) ### Commands Used #### 1. Clone the repository ```bash git clone https://github.com/ngh227/tekton-client-plugin.git cd tekton-client-plugin git remote add upstream https://github.com/jenkinsci/tekton-client-plugin.git ``` #### 2. Switch to Java 11 (required for Jenkins compatibility) ```bash export JAVA_HOME=$(/usr/libexec/java_home -v11) export PATH=$JAVA_HOME/bin:$PATH alias java="$JAVA_HOME/bin/java" java -version # Confirmed: openjdk version "11.x.x" ``` Java 17+ caused test harness and runtime errors (Unsupported class file major version 61), so Java 11 is mandatory #### 3. Build the plugin ```bash mvn clean install -DskipTests ``` Goal: Ensure all classes compile and HPI file is generated successfully. Result: [INFO] BUILD SUCCESS #### 4. Run Jenkins locally with the plugin ```bash mvn hpi:run ``` Goal: Spin up a Jenkins server with this plugin loaded in a dev Jetty container Access Jenkins at http://localhost:8080/jenkins ## Week 2 : Modernizing Jenkins Plugins ### Current Status The Tekton Client Plugin is currently configured with the following settings: - `plugin-pom`: **4.18** - `jenkins.version`: **2.263.1** - `java.level`: **8** - Jenkins BOM: **bom-2.249.x** - Compatible with **Java 11**, but **not Java 17** These versions are outdated and no longer supported by the Jenkins Update Center. The plugin cannot build or run properly in Jenkins environments that require Java 17, which is now the standard. ### Objective - Update Jenkins version to the currently recommended versions: 2.492.3 - The plugin can run on Java 17 Reference: https://www.youtube.com/watch?v=Fev8KfFsPZE # PHASE 2: CODING ## Week 3: Continue debugging to upgrade Jenkins version ## Week 4: End-to-End Intergration Testing ### Objective: Run Jenkins and Tekton in the same K8s cluster to perform end to end integration testing of the Tekton Client Plugin ### Environment | Tool | Version | Note |---------|---------|----------------------------------------- | Docker | 28.0.4 | | kind | 0.29.0 | runs Kubernetes clusters inside Docker | kubectl | 1.33.2 | CLI for controlling Kubernetes | helm | 3.18.3 | tool to install apps like Jenkins easily ### Command Used: 1. Create a Kubernetes Cluster (named 'tekton-test' with Kind) ```bash kind create cluster --name tekton-test kubectl cluster-info --context kind-tekton-test ``` 2. Install Jenkins via Helm ```bash helm repo add jenkins https://charts.jenkins.io helm repo update kubectl create namespace jenkins helm install jenkins jenkins/jenkins -n jenkins ``` 3. Build Docker Image that store Jenkins + Plugin: ```bash mvn clean install -DskipTests docker build -t tekton-plugin-local -f Dockerfile . ``` 4. Load Jenkins image into cluster ```bash kind load docker-image tekton-plugin-local --name tekton-test ``` ### What is Integration Test? Integration Test (or E2E test) is to test the real functionality of the plugin in the environment with Jenkins, Tekton, the running real pipeline, and waiting for response [ Java Plugin Code ] │ ▼ ┌───────────────┐ │ mvn install │──▶ Generates .hpi file └───────────────┘ │ ▼ ┌───────────────────────────────────────────────┐ │ Dockerfile.jenkins │ │ FROM jenkins/jenkins:lts │ │ COPY tekton-client.hpi → /usr/share/plugins │ └───────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────┐ │ docker build │ │ → Image: tekton-plugin-local│ └─────────────────────────────┘ │ ▼ ┌─────────────────────────────┐ │ kind create cluster │ │ (e.g., tekton-test) │ └─────────────────────────────┘ │ ▼ ┌──────────────────────────────────────────┐ │ kind load docker-image │ │ → Loads `tekton-plugin-local` into Kind │ └──────────────────────────────────────────┘ │ ▼ ┌────────────────────────────────────────────────────────────┐ │ helm install jenkins │ │ --set image=tekton-plugin-local │ │ --set imagePullPolicy=Never │ │ Result: │ │ ▪ Jenkins Deployment in `jenkins` namespace │ │ ▪ Jenkins Pod runs with your custom image + plugin │ └────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────┐ │ kubectl apply Tekton YAML │ │ (installs Tekton CRDs & pods) │ └─────────────────────────────────┘ │ ▼ ┌────────────────────────────────────────────────────────────────┐ │ Jenkins runs Pipeline that uses TektonClient plugin │ │ - `tektonCreateRaw`, `tektonDelete`, etc. │ │ - Interacts with Tekton via Kubernetes API │ │ - Plugin sends CRDs (Pipeline, PipelineRun...) to Tekton │ └────────────────────────────────────────────────────────────────┘ │ ▼ ┌───────────────────────────────┐ │ Tekton Pipelines Controller │ │ - Accepts CRDs │ │ - Manages actual pipelines │ │ - Can be verified via `kubectl get` or `tkn`│ └───────────────────────────────┘ ### Java 21 compatibility: Errors encounterer: 1. LogUtils: - Reason: Guava has removed LineReader since version 20.0. When updating to JDK 21, Maven might have automatically updated dependencies with the newer version of Guava (30.0+) - Solution: Java 8+ has BufferedReader with better methods ## July 14th Test coverage: