Guest User

Untitled

a guest
Aug 13th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. pipeline {
  2. agent any
  3. environment{
  4. SOME_CREDS = credentials('some_credential_id')
  5. //Credential can directly be used in the url ex:
  6. PYPI = "https://${SOME_CREDS}@artifactory.com/artifactory/api/pypi/PyPi/simple"
  7. }
  8. stages {
  9. stage('Init') {
  10. steps {
  11. script{
  12. //User and password env variables will be populated automatically:
  13. echo "user: ${env.SOME_CREDS_USR}"
  14. echo "pass: ${env.SOME_CREDS_PSW}"
  15. }
  16. }
  17. }
  18. }
  19. }
  20.  
  21. script {
  22. sshagent(['some_credential_id']) {
  23. sh(script: 'git fetch origin master')
  24. }
  25. }
Add Comment
Please, Sign In to add comment