feat(deps): enable Yarn and pnpm as dependency managers in the pipeline

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-25 02:59:22 +08:00
parent 300dad5010
commit 67d2fd22ea
2 changed files with 7 additions and 1 deletions

View File

@ -106,6 +106,9 @@ class DependenciesResolver {
this.getNodeVersion()
steps.log.info("Dependencies Resolver","Using YARN as dependencies manager, enable Yarn with corepack...")
steps.sh "corepack enable yarn && yarn -v"
if (cachingEnabled) {
steps.dir(this.workspace) {
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: ".${configurations.name}-yarn-cache", cacheValidityDecidingFile: 'yarn.lock']]) {
@ -129,6 +132,9 @@ class DependenciesResolver {
this.getNodeVersion()
steps.log.info("Dependencies Resolver","Using pnpm as dependencies manager, enable pnpm with corepack...")
steps.sh "corepack enable pnpm && pnpm -v"
if (cachingEnabled) {
steps.dir(this.workspace) {
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: ".${configurations.name}-pnpm-cache", cacheValidityDecidingFile: 'pnpm-lock.yaml']]) {

View File

@ -57,7 +57,7 @@ executeFreeleapsPipeline {
root: 'frontend',
language: 'javascript',
dependenciesManager: 'pnpm',
npmPackageJsonFile: 'package.json',
pnpmPackageJsonFile: 'package.json',
buildCacheEnabled: true,
buildAgentImage: 'node:lts',
buildCommand: 'pnpm -r build',