From b738a4fc8addfc99699237753ed2f16a565e4227 Mon Sep 17 00:00:00 2001 From: huskyrat Date: Tue, 17 Sep 2024 17:32:11 +0100 Subject: [PATCH 01/10] Create sonar-project.properties --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..f41641d8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=SQ-Jenkins-Test From 3b6570c35f9bd30c9e39e56c095e7f18e4c7addd Mon Sep 17 00:00:00 2001 From: huskyrat Date: Tue, 17 Sep 2024 17:46:07 +0100 Subject: [PATCH 02/10] Create Jenkinsfile Creating Jenkinsfile (Mission 11 - second commit) --- Jenkinsfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..199c3163 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,22 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + // Get some code from a GitHub repository + git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator.git' + } + } + stage('SonarQube Analysis') { + environment { + scannerHome = tool 'sonarqube' + } + steps { + withSonarQubeEnv('sonar-qube-1') { + sh "${scannerHome}/bin/sonar-scanner" + } + } + } + } +} From d6248a4a17f9cad003bb936d4659272141056279 Mon Sep 17 00:00:00 2001 From: huskyrat Date: Tue, 17 Sep 2024 17:53:41 +0100 Subject: [PATCH 03/10] Update Jenkinsfile Amended Jenkinsfile (removed .gif extension) --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 199c3163..4fea7e3a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('Checkout') { steps { // Get some code from a GitHub repository - git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator.git' + git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator' } } stage('SonarQube Analysis') { From 13bc1e1705d26d770fc4431c35ec8713b8c94751 Mon Sep 17 00:00:00 2001 From: huskyrat Date: Tue, 17 Sep 2024 18:19:01 +0100 Subject: [PATCH 04/10] Update Jenkinsfile with server name Added server name (VM name of sonarqube-student4 in Jenkinsfile) --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4fea7e3a..c3f00446 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,10 +13,11 @@ pipeline { scannerHome = tool 'sonarqube' } steps { - withSonarQubeEnv('sonar-qube-1') { + withSonarQubeEnv('sonarqube-student4') { sh "${scannerHome}/bin/sonar-scanner" } } } } } + From 55a355b290caa30d3127d80d7230b23031cf61d1 Mon Sep 17 00:00:00 2001 From: huskyrat Date: Tue, 17 Sep 2024 18:28:00 +0100 Subject: [PATCH 05/10] Update Jenkinsfile with name of SonarQube tool (sonar-qube-test-job) --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c3f00446..6b8c7d5f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { } steps { withSonarQubeEnv('sonarqube-student4') { - sh "${scannerHome}/bin/sonar-scanner" + sh "${scannerHome}/bin/jenkens-sonarqube-test-job" } } } From 708d202581e400570fd07fdc9f924b8d4a39c247 Mon Sep 17 00:00:00 2001 From: huskyrat Date: Wed, 18 Sep 2024 08:39:59 +0100 Subject: [PATCH 06/10] Update Jenkinsfile (with Peter) --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6b8c7d5f..f79d1792 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('Checkout') { steps { // Get some code from a GitHub repository - git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator' + git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator.git' } } stage('SonarQube Analysis') { @@ -13,8 +13,8 @@ pipeline { scannerHome = tool 'sonarqube' } steps { - withSonarQubeEnv('sonarqube-student4') { - sh "${scannerHome}/bin/jenkens-sonarqube-test-job" + withSonarQubeEnv('sonar-qube-1') { + sh "${scannerHome}/bin/sonar-scanner" } } } From ed10ca93eba7217d679ffa3ef6910a1f7d171187 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 18 Sep 2024 09:46:55 +0100 Subject: [PATCH 07/10] update to jenkins --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f79d1792..eea1f366 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('Checkout') { steps { // Get some code from a GitHub repository - git branch: 'main', url: 'git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator.git' + git branch: 'main', url: 'https://github.com/huskyrat/lbg-vat-calculator.git' } } stage('SonarQube Analysis') { @@ -19,5 +19,4 @@ pipeline { } } } -} - +} \ No newline at end of file From 1b9420dfd6b10cb7bc3de7d9bcd6f7f01c7a8bc4 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 18 Sep 2024 10:52:35 +0100 Subject: [PATCH 08/10] Added SonarQube quality gate to the Jenkinsfile --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index eea1f366..0597fc84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,4 @@ +// This adds a quality gate that aborts the pipeline if the quality threshold isn't met pipeline { agent any @@ -15,8 +16,11 @@ pipeline { steps { withSonarQubeEnv('sonar-qube-1') { sh "${scannerHome}/bin/sonar-scanner" - } + } + timeout(time: 10, unit: 'MINUTES'){ + waitForQualityGate abortPipeline: true } } } +} } \ No newline at end of file From 6b8b0fd28829dc1729d73ef264e23120ece188e0 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 18 Sep 2024 11:25:59 +0100 Subject: [PATCH 09/10] Changed border colour to Cyan --- src/App.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index 11d7b445..009f5a0a 100644 --- a/src/App.css +++ b/src/App.css @@ -4,7 +4,7 @@ } .colour-border{ - border: 3px solid green; + border: 3px solid cyan; padding: 10px; } From de7c8310d20e85680791aeeca850747bb9f803c3 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 18 Sep 2024 11:43:52 +0100 Subject: [PATCH 10/10] widened the padding on the border --- src/App.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index 009f5a0a..ddc1a62b 100644 --- a/src/App.css +++ b/src/App.css @@ -9,5 +9,5 @@ } .header{ - padding: 10px; + padding: 30px; } \ No newline at end of file