Skip to content

Commit

Permalink
add Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
m2rads committed Oct 23, 2024
1 parent 6dcc744 commit 381c675
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline {
agent {
docker {
image 'node:20'
args '-u root' // Run as root to handle permissions
}
}

stages {
stage('Checkout') {
steps {
// First configure git to trust the workspace directory
sh 'git config --global --add safe.directory "*"'

// Then do the git checkout
git branch: 'feat/tdd',
url: 'https://github.com/m2rads/shortest-test'

// Print current branch for verification
sh 'git branch --show-current'
}
}

stage('Setup PNPM') {
steps {
sh '''
npm install -g pnpm
pnpm --version
'''
}
}

stage('Install Dependencies') {
steps {
sh 'pnpm install'
}
}

stage('Install Coverage Tool') {
steps {
sh 'pnpm add -D @vitest/coverage-v8'
}
}

stage('Run Tests') {
steps {
sh 'npx vitest run'
}
}
}
}

0 comments on commit 381c675

Please sign in to comment.