Score:1

Same Jenkinsfile works differently in two apparently equal servers

bd flag

I've been forced to change a jenkins server from one server to another twice. The first time, I moved it from an Ubuntu 20.04 server to an Ubuntu 21 without problems; the build (multibranch pipeline) worked fine.

But now I've been forced to change the jenkins again to another server that runs Debian 10 and now the pipeline skips all steps except checkout and post (sending an email).

This is the Jenkinsfile:

pipeline {
    agent any
    environment {
        GIT_BRANCH = "origin/${BRANCH_NAME}"
        BRANCH_NAME = "${BRANCH_NAME}"
        REGISTRY_CREDENTIALS = credentials('REDACTED')
        REGISTRY= "my.remote.regsitry"
    }

    stages {
        stage ('Checkout') {
            steps {
                checkout scm
            }
        }

        stage ('Build') {
            steps {
                sh '''#!/bin/bash
                cd ci
                
                echo "BRANCH_NAME=$BRANCH_NAME"
                echo "GIT_BRANCH=$GIT_BRANCH"
                
                ./build.sh my.remote.registry
                '''
            }
        }

        stage ('Push') {
            steps {
                sh '''#!/bin/bash
                cd ci

                echo "Logging in the $REGISTRY registry as $REGISTRY_CREDENTIALS_USR ..."

                if ( ! docker login -p "$REGISTRY_CREDENTIALS_PSW" -u "$REGISTRY_CREDENTIALS_USR" "$REGISTRY" ) ; then
                        echo "Could not login to ${REGISTRY}. Aborting..."
                        return 1;
                fi

                ./push.sh dockdev.epiclabs.io
                if [ -e alias.sh ] ; then
                    . ./gitinfo.sh
                    ./alias.sh "$TAG" "$BRANCH" my.remote.registry
                    ./push.sh --tag "$BRANCH" my.remote.registry
                fi
                '''
            }
        }

        stage ('Deploy') {
            steps {
                sh '''#!/bin/bash
                cd ci
                ./deploy.sh "192.168.10.254/cid" my.remote.registry
                '''
            }
        }
    }

    post {  
         always {
            emailext attachLog: true,
            body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n",
            subject: "CID Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
            to: 'REDACTED'
        }
    }
}

The pipeline behaves well in the first two servers (deploy it's supposed to fail, that is not the issue I'm talking about :) ): Pipeline with all steps

But now it's skipping steps: Pipeline that skips all relevant steps

There are no logs that reflect any errors. I don't know where else to look.

bd flag
Well, the new server was trying to use credentials that no longer existed.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.