added rubocop linting section with output for reports and clean up

rubocop config
pull/29/head
Adam Townsend 2023-10-22 13:16:20 -07:00
parent bf6ed14b5e
commit 282a07c5fb
1 changed files with 6 additions and 3 deletions

9
Jenkinsfile vendored
View File

@ -20,6 +20,9 @@ pipeline {
sh 'sequel -m db/migrations sqlite://db/${DB_NAME}' sh 'sequel -m db/migrations sqlite://db/${DB_NAME}'
} }
} }
stage('Code Linting') {
sh 'bundle exec rubocop --format html --out rubocop.html'
}
stage('Run tests') { stage('Run tests') {
steps { steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
@ -37,9 +40,9 @@ pipeline {
alwaysLinkToLastBuild: false, alwaysLinkToLastBuild: false,
keepAll: true, keepAll: true,
reportDir: '.', reportDir: '.',
reportFiles: 'cucumber.html, spec.html, coverage/index.html', reportFiles: 'rubocop.html, cucumber.html, spec.html, coverage/index.html',
reportName: 'Test Results', reportName: 'Test Results',
reportTitles: 'Cucumber Results, RSpec Results, Test Coverage']) reportTitles: 'Rubocop Results, Cucumber Results, RSpec Results, Test Coverage'])
} }
} }
stage('Build production deliverable') { stage('Build production deliverable') {
@ -53,7 +56,7 @@ pipeline {
cp .env.rb /tmp/url-shortener/ cp .env.rb /tmp/url-shortener/
cp .ruby-version /tmp/url-shortener/ cp .ruby-version /tmp/url-shortener/
cd /tmp/url-shortener cd /tmp/url-shortener
rm -rf features spec coverage db/*.db .git* Jenkinsfile *.html rm -rf features spec coverage db/*.db .git* Jenkinsfile *.html .rubocop.yml
cd /tmp cd /tmp
tar -czvf $ZIP_FILE url-shortener/ tar -czvf $ZIP_FILE url-shortener/
mv /tmp/$ZIP_FILE $CUR_DIR/ mv /tmp/$ZIP_FILE $CUR_DIR/