diff --git a/first-class-pipeline/src/com/freeleaps/devops/ChangedComponentsDetector.groovy b/first-class-pipeline/src/com/freeleaps/devops/ChangedComponentsDetector.groovy index ac38ebcd..71773c3e 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/ChangedComponentsDetector.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/ChangedComponentsDetector.groovy @@ -11,7 +11,7 @@ class ChangedComponentsDetector { def detect(workspace, components) { def changedComponents = [] as Set - dir(workspace) { + steps.dir(workspace) { // using git command to get changed files list def changedFiles = sh(script: 'git diff --name-only HEAD~1 HEAD', returnStdout: true) .trim() diff --git a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy index e33e8955..e2e0ff67 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy @@ -23,6 +23,8 @@ class CommitMessageLinter { steps.log.info "Linting commit messages from HEAD..." - steps.sh "commitlint --verbose -g ${rules} -f HEAD^" + steps.dir(steps.env.workspace) { + steps.sh "commitlint --verbose -g ${rules} -f HEAD^" + } } } \ No newline at end of file diff --git a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy index a074b207..32162010 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy @@ -53,11 +53,15 @@ class DependenciesResolver { def packageJsonFile = configurations.npmPackageJsonFile if (cachingEnabled) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.npm-cache']]) { - steps.sh "npm install --cache .npm-cache" + steps.dir(steps.env.workspace) { + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.npm-cache']]) { + steps.sh "npm install --cache .npm-cache" + } } } else { - steps.sh "npm install" + steps.dir(steps.env.workspace) { + steps.sh "npm install" + } } break @@ -69,11 +73,15 @@ class DependenciesResolver { def packageJsonFile = configurations.yarnPackageJsonFile if (cachingEnabled) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.yarn-cache']]) { - steps.sh "yarn install --cache-folder .yarn-cache" + steps.dir(steps.env.workspace) { + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '.yarn-cache']]) { + steps.sh "yarn install --cache-folder .yarn-cache" + } } } else { - steps.sh "yarn install" + steps.dir(steps.env.workspace) { + steps.sh "yarn install" + } } break diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index dfb383b6..03f4a5f7 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -185,6 +185,7 @@ spec: dependenciesResolver.disableCachingSupport() } + sourceFetcher.fetch(configurations) dependenciesResolver.resolve(configurations) } }