From 282a07c5fb6ae73b7ebe43c4de40b90c9a821110 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Sun, 22 Oct 2023 13:16:20 -0700 Subject: [PATCH] added rubocop linting section with output for reports and clean up rubocop config --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b0c9ab3..63c4baa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,9 @@ pipeline { sh 'sequel -m db/migrations sqlite://db/${DB_NAME}' } } + stage('Code Linting') { + sh 'bundle exec rubocop --format html --out rubocop.html' + } stage('Run tests') { steps { catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { @@ -37,9 +40,9 @@ pipeline { alwaysLinkToLastBuild: false, keepAll: true, reportDir: '.', - reportFiles: 'cucumber.html, spec.html, coverage/index.html', + reportFiles: 'rubocop.html, cucumber.html, spec.html, coverage/index.html', reportName: 'Test Results', - reportTitles: 'Cucumber Results, RSpec Results, Test Coverage']) + reportTitles: 'Rubocop Results, Cucumber Results, RSpec Results, Test Coverage']) } } stage('Build production deliverable') { @@ -53,7 +56,7 @@ pipeline { cp .env.rb /tmp/url-shortener/ cp .ruby-version /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 tar -czvf $ZIP_FILE url-shortener/ mv /tmp/$ZIP_FILE $CUR_DIR/