---
title: "Ashish Mondal (@Hawk95) | Hashnode"
description: "I am a reckless learner who recklessly wanna learn Devops. Read the latest articles by Ashish Mondal on Hashnode."
url: "https://hashnode.com/@Hawk95"
---

@Hawk95

# Ashish Mondal

@Hawk95 · Joined May 2023

I am a reckless learner who recklessly wanna learn Devops

## Comments

[Sunita Actually i have redo that agent thing i kept it as it is the below is my jenkinsfile but the error is still the same its not getting the git pipeline { agent { docker { image 'abhishekf5/maven-abhishek-docker-agent:v1' args '--user root -v /var/run/docker.sock:/var/run/docker.sock' // mount Docker socket to access the host's Docker daemon } } stages { stage('Checkout') { steps { sh 'echo passed' //git branch: 'main', url: 'https://github.com/sunitabachhav2007/Jenkins-Zero-To-Hero.git' } } stage('Build and Test') { steps { sh 'ls -ltr' // build the project and create a JAR file sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && mvn clean package' } } stage('Static Code Analysis') { environment { SONAR\_URL = "http://35.172.186.121:9000" } steps { withCredentials(\[string(credentialsId: 'sonarqube', variable: 'SONAR\_AUTH\_TOKEN')\]) { sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && mvn sonar:sonar -Dsonar.login=$SONAR\_AUTH\_TOKEN -Dsonar.host.url=${SONAR\_URL}' } } } stage('Build and Push Docker Image') { environment { DOCKER\_IMAGE = "ashishm95/ultimate-cicd:${BUILD\_NUMBER}" // DOCKERFILE\_LOCATION = "java-maven-sonar-argocd-helm-k8s/spring-boot-app/Dockerfile" REGISTRY\_CREDENTIALS = credentials('docker-cred') } steps { script { sh 'cd java-maven-sonar-argocd-helm-k8s/spring-boot-app && docker build -t ${DOCKER\_IMAGE} .' def dockerImage = docker.image("${DOCKER\_IMAGE}") docker.withRegistry('https://index.docker.io/v1/', "docker-cred") { dockerImage.push() } } } } stage('Update Deployment File') { environment { GIT\_REPO\_NAME = "Jenkins-integration" GIT\_USER\_NAME = "Hawk-95" } steps { withCredentials(\[string(credentialsId: 'github', variable: 'GITHUB\_TOKEN')\]) { sh ''' git config user.email "mondalashish74@gmail.com" git config user.name "Hawk-95" BUILD\_NUMBER=${BUILD\_NUMBER} sed -i -e "s/ultimate-cicd.\*/ultimate-cicd:${BUILD\_NUMBER}/g" java-maven-sonar-argocd-helm-k8s/spring-boot-app-manifests/deployment.yml git add java-maven-sonar-argocd-helm-k8s/spring-boot-app-manifests/deployment.yml git commit -m "Update deployment image to version ${BUILD\_NUMBER}" git push https://${GITHUB\_TOKEN}@github.com/${GIT\_USER\_NAME}/${GIT\_REPO\_NAME} HEAD:main ''' } } } } } error Started by user Ashish Mondal Obtained java-maven-sonar-argocd-helm-k8s/spring-boot-app/JenkinsFile from git https://github.com/Hawk-95/Jenkins-integration.git \[Pipeline\] Start of Pipeline \[Pipeline\] node Running on Jenkins in /var/lib/jenkins/workspace/jenkins-git-intigration \[Pipeline\] { \[Pipeline\] stage \[Pipeline\] { (Declarative: Checkout SCM) \[Pipeline\] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE No credentials specified git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/jenkins-git-intigration/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://github.com/Hawk-95/Jenkins-integration.git # timeout=10 Fetching upstream changes from https://github.com/Hawk-95/Jenkins-integration.git git --version # timeout=10 git --version # 'git version 2.34.1' git fetch --tags --force --progress -- https://github.com/Hawk-95/Jenkins-integration.git +refs/heads/:refs/remotes/origin/ # timeout=10 git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision a3526aec3aa9886f89e5d46286ba2af7f2b49080 (refs/remotes/origin/main) git config core.sparsecheckout # timeout=10 git checkout -f a3526aec3aa9886f89e5d46286ba2af7f2b49080 # timeout=10 Commit message: "Update deployment.yml" git rev-list --no-walk a3526aec3aa9886f89e5d46286ba2af7f2b49080 # timeout=10 \[Pipeline\] } \[Pipeline\] // stage \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh docker inspect -f . abhishekf5/maven-abhishek-docker-agent:v1 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/abhishekf5/maven-abhishek-docker-agent:v1/json": dial unix /var/run/docker.sock: connect: permission denied \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh docker pull abhishekf5/maven-abhishek-docker-agent:v1 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=abhishekf5%2Fmaven-abhishek-docker-agent&tag=v1": dial unix /var/run/docker.sock: connect: permission denied \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // node \[Pipeline\] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab#reply-64747bd022df5ead69e5e714)

Reply · Article · May 29, 2023 · [Jenkins Pipeline for Java based application using Maven, SonarQube, Argo CD and Kubernetes](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c)

[hii this is amazing but i ran into an error in build stage can anyone help Started by user Ashish Mondal Obtained java-maven-sonar-argocd-helm-k8s/spring-boot-app/JenkinsFile from git https://github.com/Hawk-95/Jenkins-integration.git \[Pipeline\] Start of Pipeline \[Pipeline\] node Running on Jenkins in /var/lib/jenkins/workspace/ultimate-demo \[Pipeline\] { \[Pipeline\] stage \[Pipeline\] { (Declarative: Checkout SCM) \[Pipeline\] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE No credentials specified git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/ultimate-demo/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://github.com/Hawk-95/Jenkins-integration.git # timeout=10 Fetching upstream changes from https://github.com/Hawk-95/Jenkins-integration.git git --version # timeout=10 git --version # 'git version 2.34.1' git fetch --tags --force --progress -- https://github.com/Hawk-95/Jenkins-integration.git +refs/heads/:refs/remotes/origin/ # timeout=10 git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision acaf393f80b94a5b905e891661d5da7e7af51868 (refs/remotes/origin/main) git config core.sparsecheckout # timeout=10 git checkout -f acaf393f80b94a5b905e891661d5da7e7af51868 # timeout=10 Commit message: "Update JenkinsFile" git rev-list --no-walk b96312af3baf66c1301f51c409f6cb589166b549 # timeout=10 \[Pipeline\] } \[Pipeline\] // stage \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh docker inspect -f . ashishm95/maven-abhishek-docker-agent:v1 Error: No such object: ashishm95/maven-abhishek-docker-agent:v1 \[Pipeline\] isUnix \[Pipeline\] withEnv \[Pipeline\] { \[Pipeline\] sh docker pull ashishm95/maven-abhishek-docker-agent:v1 Error response from daemon: pull access denied for ashishm95/maven-abhishek-docker-agent, repository does not exist or may require 'docker login': denied: requested access to the resource is denied \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // withEnv \[Pipeline\] } \[Pipeline\] // node \[Pipeline\] End of Pipeline ERROR: script returned exit code 1 Finished: FAILURE](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c/comment/6474478e78c17ca4128053ab)

Comment · Article · May 29, 2023 · [Jenkins Pipeline for Java based application using Maven, SonarQube, Argo CD and Kubernetes](https://hashnode.com/posts/jenkins-pipeline-for-java-based-application-using-maven-sonarqube-argo-cd-and-kubernetes/6433c5160ed6fbd4103f154c)

[very helpfull and knowladgable](https://hashnode.com/posts/prerequisite-for-deployment-of-a-reddit-copy-on-kubernetes-with-ingress-enabled/64011029f46246ab70d47ac9/comment/646fa5b81e81847759a6a2ba)

Comment · Article · May 25, 2023 · [Prerequisite For Deployment of a Reddit Copy on Kubernetes with Ingress Enabled](https://hashnode.com/posts/prerequisite-for-deployment-of-a-reddit-copy-on-kubernetes-with-ingress-enabled/64011029f46246ab70d47ac9)
