You do not pass any credentials around the script in the pipeline,
So the command “git pull” failed because does not have a way to authenticate. Check the article and the video of my previous message, there is explained how to pass credentials to your script.

El 12 oct 2022, a las 8:13, pooja pooja <pooja.pt...@gmail.com> escribió:


this is my deploy.sh file
#!/bin/bash

ssh ubuntu@65.0.256.137 <<EOF
#cd /home/ubuntu/GJ_DEV/GJ_API
cd  gj/pat
sudo git pull
pm2 restart all
pm2 status

pipeline script
currentBuild.displayName = "gj-api-#"+currentBuild.number
pipeline{
    agent any
    stages{
        stage("GITLAB_CHECKOUT"){
            steps{
                git branch: 'development', credentialsId: 'GITHUB1', url:'https://github.com/gj/pat.git'
            }
        }
        stage("pm2 start"){
            steps{
                sh 'chmod u+x ./scripts/deploy.sh'
                sh './scripts/deploy.sh'
            }
        }
    }


can you guys tell me, where the script was wrong,am not able to find the error



On Tue, Oct 11, 2022 at 10:00 PM Ivan Fernandez Calvo <kuisathave...@gmail.com> wrote:
one more thing to pass the Git credentials to your script you could check this articles

https://www.jenkins.io/blog/2021/07/27/git-credentials-binding-phase-1/
El martes, 11 de octubre de 2022 a las 18:28:26 UTC+2, Ivan Fernandez Calvo escribió:
The error is related to something your script is doing, it is not related to Jenkins at all. Try to review the code you are executing and figure out which line is and what is wrong. Googling the error seems related to configuring the git user and git email and the git authentication when you access GitHub using HTTPS URLs. It seems to be an error message from Ruby code. The solution seems to add the authentication to the URL or use an authentication store proper for your environment (I preferer to use gh see https://cli.github.com/manual/gh_auth_setup-git), but I am not sure depends on your script.

https://stackoverflow.com/questions/54454853/fatal-could-not-read-username-for-https-github-com-no-such-device-or-addr
El martes, 11 de octubre de 2022 a las 13:37:53 UTC+2, pooja...@gmail.com escribió:
Hi mark and Mithun,

am getting error in jenkins 
image.png

On Tue, Oct 11, 2022 at 9:59 AM pooja pooja <pooja...@gmail.com> wrote:
this is my exact issue

image.png

On Mon, Oct 10, 2022 at 7:15 PM Mithun Raj <mra...@gmail.com> wrote:
1. Update your OS,

2. Check if the Git credentials are injected correctly,
If running from bastion host or jump box make sure your git hub or enterprise hostnames and IP are updated (ask git admin) in the hosts file under /etc/hosts

3. Update—env is the Git global env for git
You can either set or unset those in your Linux machine it’s your Git ID and pass which you can set as global access. not recommended if you have set it under Jenkins credentials.


On Mon, 10 Oct 2022 at 5:49 PM, pooja pooja <pooja...@gmail.com> wrote:
in jenkins am getting below error
New release '22.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it.
 fatal: could not read Username for 'https://github.com': No such device or address
 Use --update-env to update environment variables

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cec7b2ee-88ba-417d-be66-95d4954dbbfen%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANwMLksgv3L6S%2BGdZmXxq0fw8eOCJ_HW-3sbRqpDhnqsB6X71A%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9bed72a1-5419-42fe-ae55-775f0793aa10n%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/4MFd7CVFD3U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANJUvtw-EsuDApVVxmECUL9ZDhyKxJff5jN%2ByxgPcJXxUhh8nw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/D7B0C04C-78A5-459A-8953-FB16498D0B7A%40gmail.com.

Reply via email to