Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

changeset in jenkins pipeline

stage ("Deploy branches") {
    agent any

    when { 
        allOf {
            not { branch 'master' }
            changeset "some-directory/**"
            expression {  // there are changes in some-directory/...
                sh(returnStatus: true, script: 'git diff  origin/master --name-only | grep --quiet "^some-directory/.*"') == 0
            }
            expression {   // ...and nowhere else.
                sh(returnStatus: true, script: 'git diff origin/master --name-only | grep --quiet --invert-match "^some-directory/.*"') == 1
            }
        }
    }

    steps {
        // do stuff
    }
}
Comment

PREVIOUS NEXT
Code Example
Shell :: how to kill vscode linux 
Shell :: Clear heroku redis cache 
Shell :: git stash apply item 
Shell :: test internet speed command line 
Shell :: ubuntu fingerprint error 
Shell :: sdkman install 
Shell :: read line by using linnumber shell 
Shell :: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path. 
Shell :: install spotify ubuntu 
Shell :: create a new repository on command line github 
Shell :: git commit back in time 
Shell :: nvidia open source driver arch linux 
Shell :: bash command to open terminal 
Shell :: add ssh to already cloned repo 
Shell :: git clean branches 
Shell :: gitignore idea 
Shell :: how to copy ssh key 
Shell :: cli check what is listening on port 
Shell :: github setup 
Shell :: dd write iso to usb linux 
Shell :: speed test cli 
Shell :: ansible sudo pass 
Shell :: how to restart postgresql ubuntu 
Shell :: ubuntu check ssh 
Shell :: how to run shell script in linux 
Shell :: error could not lock config file .git/config permission denied ubuntu 
Shell :: ionic start server 
Shell :: navigate to drive d cmd 
Shell :: sh: 1: nodemon: not found 
Shell :: stop tracking files git 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =