Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent any
- environment{
- SOME_CREDS = credentials('some_credential_id')
- //Credential can directly be used in the url ex:
- PYPI = "https://${SOME_CREDS}@artifactory.com/artifactory/api/pypi/PyPi/simple"
- }
- stages {
- stage('Init') {
- steps {
- script{
- //User and password env variables will be populated automatically:
- echo "user: ${env.SOME_CREDS_USR}"
- echo "pass: ${env.SOME_CREDS_PSW}"
- }
- }
- }
- }
- }
- script {
- sshagent(['some_credential_id']) {
- sh(script: 'git fetch origin master')
- }
- }
Add Comment
Please, Sign In to add comment