Skip to content

Instantly share code, notes, and snippets.

@darinpope
Last active September 14, 2023 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save darinpope/e36d2bcaf56a98dfe5baab3ac5da3694 to your computer and use it in GitHub Desktop.
Save darinpope/e36d2bcaf56a98dfe5baab3ac5da3694 to your computer and use it in GitHub Desktop.

Gist for https://youtu.be/rNCMAFZ6zho

Pipeline definitions

job-1

pipeline {
    agent any

    stages {
        stage('stage 1') {
            steps {
                echo "${env.BUILD_NUMBER}"
            }
        }
        stage('stage 2') {
            steps {
                sh "echo $BUILD_NUMBER"
            }
        }
    }
}

job-2

pipeline {
    agent any
    environment {
        SERVICE_CREDS = credentials('my-secret-text')
    }
    stages {
        stage('stage 1') {
            steps {
                sh "echo $SERVICE_CREDS"
            }
        }
    }
}

job-3

pipeline {
    agent any
    environment {
        SERVICE_CREDS = credentials('my-secret-text')
    }
    stages {
        stage('stage 1') {
            steps {
                sh 'echo $SERVICE_CREDS'
            }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment