Home > Mobile >  Why does Jenkins delete files starting with dots?
Why does Jenkins delete files starting with dots?

Time:04-27

I use a bundle of Jenkins Gitlab and that's when my pipeline starts its work, I observe the absence of all files starting with a dot

pipeline {
   agent any
   stages {
       stage('Initialization') {
          steps {
             sh 'ls -l'
             updateGitlabCommitStatus name: 'Build&Deploy', state: 'pending'
             git branch: env.gitlabBranch, credentialsId: 'id', url: 'link'
          }
       }
   }}

Example of a deleted file

  1. .env
  2. .eslintrc.ls

CodePudding user response:

The unix command ls -l executed within the shell interpreter used by the sh step method will not show files beginning with a .. You need to update the method argument to:

sh('ls -la')
  • Related