I have a docker container which runs Jenkins.
Inside Jenkinsfile, I try to define an alias and print this alias.
I tried it manually, connecting to Jenkins container, and I am able to do:
alias foo='bar'
and then, if I execute alias I can see the list of alias ( I have 7 preset alias, and the new one )
but when I execute the same thing in Jenkinsfile, I foo command won't respond...
Here is my pipeline code:
#!/bin/groovy
pipeline {
agent any
stages {
stage("Use alias command"){
steps {
sh 'alias foo="bar"'
sh 'foo'
}
}
}}
Any idea why ?