From 0db1af340825ea7027496496a2f8f71522d1f419 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 15:33:58 -0700 Subject: [PATCH 01/22] fix: Delete worker/Jenkinsfile as is created in labs Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- worker/Jenkinsfile | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 worker/Jenkinsfile diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile deleted file mode 100644 index b66016b2..00000000 --- a/worker/Jenkinsfile +++ /dev/null @@ -1,41 +0,0 @@ -pipeline { - agent{ - docker{ - image 'maven:3.9.8-sapmachine-21' - args '-v $HOME/.m2:/root/.m2' - } - } - stages{ - stage('build'){ - steps{ - echo 'building worker app' - dir('worker'){ - sh 'mvn compile' - } - } - } - stage('test'){ - steps{ - echo 'running unit tests on worker app' - dir('worker'){ - sh 'mvn clean test' - } - } - } - stage('package'){ - steps{ - echo 'packaging worker app into a jarfile' - dir('worker'){ - sh 'mvn package -DskipTests' - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true - } - } - } - } - post{ - always{ - echo 'the job is complete' - - } - } -} From 96695ab1ab9a0f84e83633316e8bfee7df447f75 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 15:36:08 -0700 Subject: [PATCH 02/22] Create lab5.1_worker_jenkinsfile_slack_integration Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- ...ab5.1_worker_jenkinsfile_slack_integration | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 gists/lab5.1_worker_jenkinsfile_slack_integration diff --git a/gists/lab5.1_worker_jenkinsfile_slack_integration b/gists/lab5.1_worker_jenkinsfile_slack_integration new file mode 100644 index 00000000..4e2ab904 --- /dev/null +++ b/gists/lab5.1_worker_jenkinsfile_slack_integration @@ -0,0 +1,52 @@ +pipeline { + agent any + tools{ + maven 'maven 3.9.8' + } + stages{ + stage(build){ + when{ + changeset "**/worker/**" + } + steps{ + echo 'Compiling worker app..' + dir('worker'){ + sh 'mvn compile' + } + } + } + stage(test){ + when{ + changeset "**/worker/**" + } + steps{ + echo 'Running Unit Tests on worker app..' + dir('worker'){ + sh 'mvn clean test' + } + } + } + stage(package){ + when{ + branch 'master' + changeset "**/worker/**" + } + steps{ + echo 'Packaging worker app' + dir('worker'){ + sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true } + } + } + } + post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' + } + failure{ + slackSend (channel: "instavote-cd", message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)") } + success{ + slackSend (channel: "instavote-cd", message: "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)") + } + } +} From 7da2956dbc339b01d352d481f37b8ef544659841 Mon Sep 17 00:00:00 2001 From: Eric Egan Date: Wed, 2 Jul 2025 18:28:11 -0700 Subject: [PATCH 03/22] feature: update plugin release to modern usage in worker/pom.xml Signed-off-by: Eric Egan --- worker/pom.xml | 3 +-- worker/src/test/java/worker/UnitWorker.java | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/pom.xml b/worker/pom.xml index 15e1b5b5..c0c97644 100644 --- a/worker/pom.xml +++ b/worker/pom.xml @@ -67,8 +67,7 @@ maven-compiler-plugin 3.12.1 - 11 - 11 + 11 diff --git a/worker/src/test/java/worker/UnitWorker.java b/worker/src/test/java/worker/UnitWorker.java index 8637d3f8..33e995e9 100644 --- a/worker/src/test/java/worker/UnitWorker.java +++ b/worker/src/test/java/worker/UnitWorker.java @@ -1,3 +1,5 @@ +package worker; + import org.junit.jupiter.api.Test; class UnitWorker { From dc14120b8fdfc8556b89e8ed6f0a019911fd2ccd Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 18:34:54 -0700 Subject: [PATCH 04/22] Create lab7_per_stage_jenkinsfile Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/lab7_per_stage_jenkinsfile | 89 ++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 gists/lab7_per_stage_jenkinsfile diff --git a/gists/lab7_per_stage_jenkinsfile b/gists/lab7_per_stage_jenkinsfile new file mode 100644 index 00000000..dc5d77af --- /dev/null +++ b/gists/lab7_per_stage_jenkinsfile @@ -0,0 +1,89 @@ +pipeline { + + agent none + + stages{ + stage("build"){ + when{ + changeset "**/worker/**" + } + + agent{ + docker{ + image 'maven:3.9.8-sapmachine-21' + args '-v $HOME/.m2:/root/.m2' + } + } + + steps{ + echo 'Compiling worker app..' + dir('worker'){ + sh 'mvn compile' + } + } + } + stage("test"){ + when{ + changeset "**/worker/**" + } + agent{ + docker{ + image 'maven:3.9.8-sapmachine-21' + args '-v $HOME/.m2:/root/.m2' + } + } + steps{ + echo 'Running Unit Tets on worker app..' + dir('worker'){ + sh 'mvn clean test' + } + + } + } + stage("package"){ + when{ + branch 'master' + changeset "**/worker/**" + } + agent{ + docker{ + image 'maven:3.9.8-sapmachine-21' + args '-v $HOME/.m2:/root/.m2' + } + } + steps{ + echo 'Packaging worker app' + dir('worker'){ + sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true + } + + } + } + + stage('docker-package'){ + agent any + when{ + changeset "**/worker/**" + branch 'master' + } + steps{ + echo 'Packaging worker app with docker' + script{ + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { + def workerImage = docker.build("xxxxx/worker:v${env.BUILD_ID}", "./worker") + workerImage.push() + workerImage.push("${env.BRANCH_NAME}") + workerImage.push("latest") + } + } + } + } + } + + post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' + } + } +} From 5272e36e498d5371c8f7801061aa95e7268275cb Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 19:24:16 -0700 Subject: [PATCH 05/22] Create lab8_docker_compose_yaml Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/lab8_docker_compose_yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gists/lab8_docker_compose_yaml diff --git a/gists/lab8_docker_compose_yaml b/gists/lab8_docker_compose_yaml new file mode 100644 index 00000000..61582e5b --- /dev/null +++ b/gists/lab8_docker_compose_yaml @@ -0,0 +1,13 @@ +services: + vote: + image: xxxxx/vote:latest + ports: + - 5000:80 + + result: + image: xxxxx/result:latest + ports: + - 5001:80 + + worker: + image: xxxxx/worker:latest From 1123ee306064a1dfc10aa0c84ecf8cb4c595aaf3 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 19:25:10 -0700 Subject: [PATCH 06/22] Rename lab8_docker_compose_yaml to lab8_first_docker_compose_yaml Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- .../{lab8_docker_compose_yaml => lab8_first_docker_compose_yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gists/{lab8_docker_compose_yaml => lab8_first_docker_compose_yaml} (100%) diff --git a/gists/lab8_docker_compose_yaml b/gists/lab8_first_docker_compose_yaml similarity index 100% rename from gists/lab8_docker_compose_yaml rename to gists/lab8_first_docker_compose_yaml From ff1eacc212b1a25a7d89005b98f6bae6dc067946 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Thu, 3 Jul 2025 19:28:49 -0700 Subject: [PATCH 07/22] Create lab8_DockerComposespecwithBackingServices Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- .../lab8_DockerComposespecwithBackingServices | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 gists/lab8_DockerComposespecwithBackingServices diff --git a/gists/lab8_DockerComposespecwithBackingServices b/gists/lab8_DockerComposespecwithBackingServices new file mode 100644 index 00000000..e38fd3d9 --- /dev/null +++ b/gists/lab8_DockerComposespecwithBackingServices @@ -0,0 +1,19 @@ +services: + vote: + image: xxxxx/vote:latest + ports: + - 5000:80 + + redis: + image: redis:alpine + + db: + image: postgres:9.4 + + result: + image: xxxxx/result:latest + ports: + - 5001:4000 + + worker: + image: xxxxx/worker:latest From a78e9a415eb15c268e3146ff6945faaee55cfa42 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:28:07 -0700 Subject: [PATCH 08/22] lab-8-docker-compose-yaml remove 5000 and 5001 port mappings to match lab instruct' Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/lab-8-docker-compose-yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gists/lab-8-docker-compose-yaml b/gists/lab-8-docker-compose-yaml index 392ebcac..e47bb38f 100644 --- a/gists/lab-8-docker-compose-yaml +++ b/gists/lab-8-docker-compose-yaml @@ -35,8 +35,7 @@ services: image: docker:dind ports: - 2376:2376 - - 5000:5000 - - 5001:5001 + environment: - DOCKER_TLS_CERTDIR=/certs networks: From 6912ac8823fafe50fb96ad4dca0745e83eaf3f11 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:52:58 -0700 Subject: [PATCH 09/22] feature: update to python 3.11 Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/lab_8_jenkinsfile_final | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gists/lab_8_jenkinsfile_final b/gists/lab_8_jenkinsfile_final index 6cd7116d..7f3654d2 100644 --- a/gists/lab_8_jenkinsfile_final +++ b/gists/lab_8_jenkinsfile_final @@ -147,7 +147,7 @@ pipeline { stage('vote-build') { agent { docker { - image 'python:2.7.16-slim' + image 'python:3.11-slim' args '--user root' } @@ -167,7 +167,7 @@ pipeline { stage('vote-test') { agent { docker { - image 'python:2.7.16-slim' + image 'python:3.11-slim' args '--user root' } From 2a08959e13f79da16da707861147cce213909309 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 12:44:27 -0700 Subject: [PATCH 10/22] fix: correct indent db in docker compose file Update docker-compose-spec-with-dockerfile-build-integration Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/docker-compose-spec-with-dockerfile-build-integration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gists/docker-compose-spec-with-dockerfile-build-integration b/gists/docker-compose-spec-with-dockerfile-build-integration index 947a86e1..1e1935c4 100644 --- a/gists/docker-compose-spec-with-dockerfile-build-integration +++ b/gists/docker-compose-spec-with-dockerfile-build-integration @@ -21,7 +21,7 @@ services: networks: - instavote - db: + db: image: postgres:15-alpine environment: POSTGRES_USER: "postgres" From 90e53df8eb9952b5463049a8434c4059a078db7e Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 16:24:49 -0700 Subject: [PATCH 11/22] fix: Delete vote/Dockerfile as this is created via labs. Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- vote/Dockerfile | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 vote/Dockerfile diff --git a/vote/Dockerfile b/vote/Dockerfile deleted file mode 100644 index 9e812ca9..00000000 --- a/vote/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -# Define a base stage that uses the official python runtime base image -FROM python:3.11-slim AS base - -# Add curl for healthcheck -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl && \ - rm -rf /var/lib/apt/lists/* - -# Set the application directory -WORKDIR /usr/local/app - -# Install our requirements.txt -COPY requirements.txt ./requirements.txt -RUN pip install --no-cache-dir -r requirements.txt - -# Define a stage specifically for development, where it'll watch for -# filesystem changes -FROM base AS dev -RUN pip install watchdog -ENV FLASK_ENV=development -CMD ["python", "app.py"] - -# Define the final stage that will bundle the application for production -FROM base AS final - -# Copy our code from the current folder to the working directory inside the container -COPY . . - -# Make port 80 available for links and/or publish -EXPOSE 80 - -# Define our command to be run when launching the container -CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--log-file", "-", "--access-logfile", "-", "--workers", "4", "--keep-alive", "0"] From 62ed7f4cf86f3be37e70b4037517a2bd17e05b5e Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 16:41:15 -0700 Subject: [PATCH 12/22] fix: Delete worker/Dockerfile because created in labs Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- worker/Dockerfile | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 worker/Dockerfile diff --git a/worker/Dockerfile b/worker/Dockerfile deleted file mode 100644 index 2b152eab..00000000 --- a/worker/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM maven:3.9.8-sapmachine-21 -WORKDIR /app -COPY . . -RUN mvn package && \ - mv target/worker-jar-with-dependencies.jar /run/worker.jar &&\ - rm -rf /app/* - CMD ["java", "-jar", "/run/worker.jar"] From 2f5952108baf37053e5d8ee6db7ab469d61e0099 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:05:51 -0700 Subject: [PATCH 13/22] fix: Delete result/Dockerfile because created in labs Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- result/Dockerfile | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 result/Dockerfile diff --git a/result/Dockerfile b/result/Dockerfile deleted file mode 100644 index 4fb74e8c..00000000 --- a/result/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM node:18-slim - -# add curl for healthcheck -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl tini && \ - rm -rf /var/lib/apt/lists/* - -WORKDIR /usr/local/app - -# have nodemon available for local dev use (file watching) -RUN npm install -g nodemon - -COPY package*.json ./ - -RUN npm ci && \ - npm cache clean --force && \ - mv /usr/local/app/node_modules /node_modules - -COPY . . - -ENV PORT 80 -EXPOSE 80 - -ENTRYPOINT ["/usr/bin/tini", "--"] -CMD ["node", "server.js"] From 09d7531c47eddac4bc308e31db0cd0232c6b3140 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:30:05 -0700 Subject: [PATCH 14/22] feature: Create result-dockerfile gist Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/result-dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gists/result-dockerfile diff --git a/gists/result-dockerfile b/gists/result-dockerfile new file mode 100644 index 00000000..b688d7be --- /dev/null +++ b/gists/result-dockerfile @@ -0,0 +1,25 @@ +FROM node:22.4.0-slim + +# add curl for healthcheck +RUN apt-get update && \ + apt-get install -y --no-install-recommends curl tini && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /usr/local/app + +# have nodemon available for local dev use (file watching) +RUN npm install -g nodemon + +COPY package*.json ./ + +RUN npm ci && \ + npm cache clean --force && \ + mv /usr/local/app/node_modules /node_modules + +COPY . . + +ENV PORT 80 +EXPOSE 80 + +ENTRYPOINT ["/usr/bin/tini", "--"] +CMD ["node", "server.js"] From 38e9d260a363e3f4ef062b47c8d43977d2f6a77b Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:32:18 -0700 Subject: [PATCH 15/22] feature: Create vote-dockerfile gist Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/vote-dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 gists/vote-dockerfile diff --git a/gists/vote-dockerfile b/gists/vote-dockerfile new file mode 100644 index 00000000..9e812ca9 --- /dev/null +++ b/gists/vote-dockerfile @@ -0,0 +1,33 @@ +# Define a base stage that uses the official python runtime base image +FROM python:3.11-slim AS base + +# Add curl for healthcheck +RUN apt-get update && \ + apt-get install -y --no-install-recommends curl && \ + rm -rf /var/lib/apt/lists/* + +# Set the application directory +WORKDIR /usr/local/app + +# Install our requirements.txt +COPY requirements.txt ./requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Define a stage specifically for development, where it'll watch for +# filesystem changes +FROM base AS dev +RUN pip install watchdog +ENV FLASK_ENV=development +CMD ["python", "app.py"] + +# Define the final stage that will bundle the application for production +FROM base AS final + +# Copy our code from the current folder to the working directory inside the container +COPY . . + +# Make port 80 available for links and/or publish +EXPOSE 80 + +# Define our command to be run when launching the container +CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--log-file", "-", "--access-logfile", "-", "--workers", "4", "--keep-alive", "0"] From 2d2bed848301353858944b543406e94b8b04e4c4 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:34:38 -0700 Subject: [PATCH 16/22] feature: Create worker-dockerfile gist Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/worker-dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 gists/worker-dockerfile diff --git a/gists/worker-dockerfile b/gists/worker-dockerfile new file mode 100644 index 00000000..bb6e0f79 --- /dev/null +++ b/gists/worker-dockerfile @@ -0,0 +1,6 @@ +FROM maven:3.9.8-sapmachine-21 +WORKDIR /app +COPY . . +RUN mvn package && \ + mv target/worker-jar-with-dependencies.jar /run/worker.jar && rm -rf /app/* +CMD ["java", "-jar", "/run/worker.jar"] From 745a6a6ffe6f32bb35cc63a490aaabb092b2704c Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:39:19 -0700 Subject: [PATCH 17/22] feature: Create Continuous-Deploy-Stage-Jenkinsfile gist Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/Continuous-Deploy-Stage-Jenkinsfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gists/Continuous-Deploy-Stage-Jenkinsfile diff --git a/gists/Continuous-Deploy-Stage-Jenkinsfile b/gists/Continuous-Deploy-Stage-Jenkinsfile new file mode 100644 index 00000000..2c6843cc --- /dev/null +++ b/gists/Continuous-Deploy-Stage-Jenkinsfile @@ -0,0 +1,12 @@ +stage('Trigger deployment') { + agent any + environment{ + def GIT_COMMIT = "${env.GIT_COMMIT}" + } + steps{ + echo "${GIT_COMMIT}" + echo "triggering deployment" + // passing variables to job deployment run by vote-deploy repository Jenkinsfile + build job: 'deployment', parameters: [string(name: 'DOCKERTAG', value: GIT_COMMIT)] + } + } From f2f90acd5be9d527aa4415679670529c43e7c445 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:37:38 -0700 Subject: [PATCH 18/22] Create LFS261ArgoDeployJenkinsfile Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/LFS261ArgoDeployJenkinsfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 gists/LFS261ArgoDeployJenkinsfile diff --git a/gists/LFS261ArgoDeployJenkinsfile b/gists/LFS261ArgoDeployJenkinsfile new file mode 100644 index 00000000..e1971307 --- /dev/null +++ b/gists/LFS261ArgoDeployJenkinsfile @@ -0,0 +1,26 @@ +node { + def app + + stage('Clone repository') { + + + checkout scm + } + + stage('Update GIT') { + script { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + withCredentials([usernamePassword(credentialsId: 'JenkinsGithubCreds', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { + sh "git config user.email yourGitHubEmail@email.com" + sh "git config user.name yourGitHubUsername" + sh "cat vote-ui-deployment.yaml" + sh "sed -i 's+dockerHubUserName/vote.*+dockerHubUsername/vote:${DOCKERTAG}+g' vote-ui-deployment.yaml" + sh "cat vote-ui-deployment.yaml" + sh "git add ." + sh "git commit -m 'Done by Jenkins Job deployment: ${env.BUILD_NUMBER}'" + sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${GIT_USERNAME}/vote-deploy.git HEAD:master" + } + } + } +} +} From 00f1057a59381ce2193e0e1ff96df4fa2a2c4cfb Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:39:07 -0700 Subject: [PATCH 19/22] Create vote-ui-deployment.yaml Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/vote-ui-deployment.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gists/vote-ui-deployment.yaml diff --git a/gists/vote-ui-deployment.yaml b/gists/vote-ui-deployment.yaml new file mode 100644 index 00000000..cfb2557d --- /dev/null +++ b/gists/vote-ui-deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vote-ui +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: vote-ui + template: + metadata: + labels: + app: vote-ui + spec: + containers: + - image: docker.io/xxxx/vote + name: vote-ui + ports: + - containerPort: 80 From a04394f7c1fca173ac655b7b5402dd51d6b60cca Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:41:17 -0700 Subject: [PATCH 20/22] Create vote-ui-svc.yaml Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/vote-ui-svc.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gists/vote-ui-svc.yaml diff --git a/gists/vote-ui-svc.yaml b/gists/vote-ui-svc.yaml new file mode 100644 index 00000000..7b13888e --- /dev/null +++ b/gists/vote-ui-svc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: vote-ui +spec: + type: NodePort + ports: + - port: 80 + targetPort: 80 + protocol: TCP + name: http + selector: + app: vote-ui From 1853e0ad4541840b845fd5c72db0e9d03113f8d9 Mon Sep 17 00:00:00 2001 From: eeganlf <101604439+eeganlf@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:07:39 -0700 Subject: [PATCH 21/22] feature: create lab9-sonarqube-stage-snippet Signed-off-by: eeganlf <101604439+eeganlf@users.noreply.github.com> --- gists/lab9-sonarqube-stage-snippet | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 gists/lab9-sonarqube-stage-snippet diff --git a/gists/lab9-sonarqube-stage-snippet b/gists/lab9-sonarqube-stage-snippet new file mode 100644 index 00000000..f82997bd --- /dev/null +++ b/gists/lab9-sonarqube-stage-snippet @@ -0,0 +1,31 @@ + stage('Sonarqube') { + agent any + when{ + branch 'master' + } + // tools { + // jdk "JDK11" // the name you have given the JDK installation in Global Tool Configuration + // } + + environment{ + sonarpath = tool 'SonarScanner' + } + + steps { + echo 'Running Sonarqube Analysis..' + withSonarQubeEnv('sonar-instavote') { + sh "${sonarpath}/bin/sonar-scanner -Dproject.settings=sonar-project.properties -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=86400" + } + } + } + + + stage("Quality Gate") { + steps { + timeout(time: 1, unit: 'HOURS') { + // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails + // true = set pipeline to UNSTABLE, false = don't + waitForQualityGate abortPipeline: true + } + } + } From 0246aced9845b9edb3d133098b1b096388b922b9 Mon Sep 17 00:00:00 2001 From: Saber Abbasi Date: Thu, 14 Aug 2025 05:32:05 -0700 Subject: [PATCH 22/22] Add Jenkinsfile --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..8c323b55 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +pipeline { + agent any + + stages{ + stage("one"){ + steps{ + echo 'step 1' + } + } + stage("two"){ + steps{ + echo 'step 2' + } + } + stage("three"){ + steps{ + echo 'step 3' + } + } + } + post{ + + always{ + + echo 'This pipeline is completed.' + } + } +}