From 9d8ea39a2151050a31460c1e0366fd7f33727571 Mon Sep 17 00:00:00 2001 From: realayo Date: Sat, 21 Aug 2021 14:05:49 -0400 Subject: [PATCH 01/24] added sample jenkinsfile --- Jenkinsfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..b570c92ee --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,21 @@ +pipeline { + agent any + + stages { + stage('Build') { + steps { + script { + sh 'echo "Building Stage"' + } + } + } + + stage('Test') { + steps { + script { + sh 'echo "Testing Stage"' + } + } + } + } +} \ No newline at end of file From 862bd32d29a685913b815543c0b006ff6b7b36fd Mon Sep 17 00:00:00 2001 From: realayo Date: Sat, 21 Aug 2021 14:24:16 -0400 Subject: [PATCH 02/24] Update --- Jenkinsfile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b570c92ee..f80b49d6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,29 @@ pipeline { agent any - stages { - stage('Build') { + stages { + + stage("Initial cleanup") { steps { - script { - sh 'echo "Building Stage"' + dir("${WORKSPACE}") { + deleteDir() } } } - stage('Test') { + stage('Checkout SCM') { steps { - script { - sh 'echo "Testing Stage"' - } + git branch: 'main', url: 'https://github.com/darey-devops/php-todo.git' + } + } + + stage('Prepare Dependencies') { + steps { + sh 'mv .env.sample .env' + sh 'composer install' + sh 'php artisan migrate' + sh 'php artisan db:seed' + sh 'php artisan key:generate' } } } From cd4152f72d506b9b6578ce94ded57af8e6e79c82 Mon Sep 17 00:00:00 2001 From: realayo Date: Sat, 21 Aug 2021 14:29:52 -0400 Subject: [PATCH 03/24] update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f80b49d6c..f580331ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { stage('Checkout SCM') { steps { - git branch: 'main', url: 'https://github.com/darey-devops/php-todo.git' + git branch: 'main', url: 'https://github.com/realayo/php-todo.git' } } From 95b2d97e2d97c3582c77ba9d37e61f5af4ec1d45 Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 13:46:46 -0400 Subject: [PATCH 04/24] update --- .env.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 1c39502a5..35a39d7ae 100644 --- a/.env.sample +++ b/.env.sample @@ -3,7 +3,7 @@ APP_DEBUG=true APP_KEY=SomeRandomString APP_URL=http://localhost -DB_HOST=127.0.0.1 +DB_HOST=172.31.3.135 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=sePret^i From dfa687f9dd6e917e4a4d187f57121620db890c2a Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 13:54:43 -0400 Subject: [PATCH 05/24] unit test --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f580331ac..45805da53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,5 +26,10 @@ pipeline { sh 'php artisan key:generate' } } + stage('Execute Unit Tests') { + steps { + sh './vendor/bin/phpunit' + } + } } } \ No newline at end of file From 92accb33669ee71d764375f0aa75235074ca0f4e Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 13:59:10 -0400 Subject: [PATCH 06/24] code quality analysis --- Jenkinsfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 45805da53..63b6de10a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any - stages { + stages { stage("Initial cleanup") { steps { @@ -30,6 +30,11 @@ pipeline { steps { sh './vendor/bin/phpunit' } - } - } + } + stage('Code Analysis') { + steps { + sh 'phploc app/ --log-csv build/logs/phploc.csv' + } + } + } } \ No newline at end of file From c562253830a1185842a9b4439696fdacbdc92b72 Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 14:04:07 -0400 Subject: [PATCH 07/24] Plot data --- Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 63b6de10a..ef921feb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,5 +36,21 @@ pipeline { sh 'phploc app/ --log-csv build/logs/phploc.csv' } } + stage('Plot Code Coverage Report') { + steps { + + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Lines of Code (LOC),Comment Lines of Code (CLOC),Non-Comment Lines of Code (NCLOC),Logical Lines of Code (LLOC) ', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'A - Lines of code', yaxis: 'Lines of Code' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Directories,Files,Namespaces', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'B - Structures Containers', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Average Class Length (LLOC),Average Method Length (LLOC),Average Function Length (LLOC)', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'C - Average Length', yaxis: 'Average Lines of Code' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Cyclomatic Complexity / Lines of Code,Cyclomatic Complexity / Number of Methods ', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'D - Relative Cyclomatic Complexity', yaxis: 'Cyclomatic Complexity by Structure' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Classes,Abstract Classes,Concrete Classes', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'E - Types of Classes', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Methods,Non-Static Methods,Static Methods,Public Methods,Non-Public Methods', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'F - Types of Methods', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Constants,Global Constants,Class Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'G - Types of Constants', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Test Classes,Test Methods', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'I - Testing', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Logical Lines of Code (LLOC),Classes Length (LLOC),Functions Length (LLOC),LLOC outside functions or classes ', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'AB - Code Structure by Logical Lines of Code', yaxis: 'Logical Lines of Code' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Functions,Named Functions,Anonymous Functions', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'H - Types of Functions', yaxis: 'Count' + plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'BB - Structure Objects', yaxis: 'Count' + } + } } } \ No newline at end of file From 44439ac120b59a941cd04a9a63182f987bd694c9 Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 14:10:14 -0400 Subject: [PATCH 08/24] upload to Artifactory --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index ef921feb5..d4ee3c633 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,5 +52,10 @@ pipeline { plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'BB - Structure Objects', yaxis: 'Count' } } + stage ('Package Artifact') { + steps { + sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' + } + } } } \ No newline at end of file From 8620756e677bad72fbda2fb51c8b6fde22b69b36 Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 14:14:57 -0400 Subject: [PATCH 09/24] Publish to Artifactory --- Jenkinsfile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d4ee3c633..884738e19 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,6 +56,21 @@ pipeline { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' } - } + } + stage ('Deploy Artifact') { + steps { + script { + def server = Artifactory.server 'artifactory-server' + def uploadSpec = """{ + "files": [{ + "pattern": "php-todo.zip", + "target": "php-todo" + }] + }""" + + server.upload(uploadSpec) + } + } + } } } \ No newline at end of file From 0ceeb26484bea4931b4315a969aa3a199db74e9d Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 14:19:41 -0400 Subject: [PATCH 10/24] Publish result to Artifactory --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 884738e19..57e85ef96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,7 +60,7 @@ pipeline { stage ('Deploy Artifact') { steps { script { - def server = Artifactory.server 'artifactory-server' + def server = Artifactory.server 'artifactory' def uploadSpec = """{ "files": [{ "pattern": "php-todo.zip", From c9aef771cd1a23ccc597727ddf13168114cdc77e Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 14:27:36 -0400 Subject: [PATCH 11/24] Deploy to Artifactory --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 57e85ef96..7449520af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,7 +60,7 @@ pipeline { stage ('Deploy Artifact') { steps { script { - def server = Artifactory.server 'artifactory' + def server = Artifactory.server 'Artifactory' def uploadSpec = """{ "files": [{ "pattern": "php-todo.zip", From 9009e2a5aaef7b7f7b13588b865c3e006c6e87fe Mon Sep 17 00:00:00 2001 From: realayo Date: Sun, 22 Aug 2021 15:11:38 -0400 Subject: [PATCH 12/24] Deploy the application --- Jenkinsfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7449520af..1fa884ae4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,6 +71,12 @@ pipeline { server.upload(uploadSpec) } } - } - } + } + stage ('Deploy to Dev Environment') { + steps { + build job: 'ansible-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'env', value: 'dev']], propagate: false, wait: true + + } + } + } } \ No newline at end of file From 0f4e9dc2bb23b48a4ea549f542775a1bceacbcac Mon Sep 17 00:00:00 2001 From: realayo Date: Tue, 24 Aug 2021 18:49:04 -0400 Subject: [PATCH 13/24] Added SonarQube Quality Gate --- Jenkinsfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1fa884ae4..65f1b0ae7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,6 +72,18 @@ pipeline { } } } + + stage('SonarQube Quality Gate') { + environment { + scannerHome = tool 'SonarQubeScanner' + } + steps { + withSonarQubeEnv('sonarqube') { + sh "${scannerHome}/bin/sonar-scanner" + } + } + } + stage ('Deploy to Dev Environment') { steps { build job: 'ansible-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'env', value: 'dev']], propagate: false, wait: true From 38e795641340df46f8a1bc7fa8d4715aa5d7818e Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 03:24:14 -0400 Subject: [PATCH 14/24] edited SQ quality gate --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65f1b0ae7..570af33ec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,13 +74,17 @@ pipeline { } stage('SonarQube Quality Gate') { - environment { + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { scannerHome = tool 'SonarQubeScanner' - } + } steps { withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner" + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } } } From 0be31bfdfc5c5d25c5b8d7d2e39b6b3d41203c73 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 03:32:52 -0400 Subject: [PATCH 15/24] edited SQ quality gate --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65f1b0ae7..ef65ac940 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,13 +74,17 @@ pipeline { } stage('SonarQube Quality Gate') { - environment { - scannerHome = tool 'SonarQubeScanner' - } + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { + scannerHome = tool 'SonarQubeScanner' + } steps { withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner" + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } } } From 67e5caea581bc959669ff23c2b289cd5bae9612a Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 05:12:53 -0400 Subject: [PATCH 16/24] Edited jenkinsfile --- Jenkinsfile | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef65ac940..e4948515f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,6 +52,21 @@ pipeline { plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'BB - Structure Objects', yaxis: 'Count' } } + + stage('SonarQube Quality Gate') { + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { + scannerHome = tool 'SonarQubeScanner' + } + steps { + withSonarQubeEnv('sonarqube') { + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" + } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } + } + } stage ('Package Artifact') { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' @@ -71,23 +86,7 @@ pipeline { server.upload(uploadSpec) } } - } - - stage('SonarQube Quality Gate') { - when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - environment { - scannerHome = tool 'SonarQubeScanner' - } - steps { - withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - } - timeout(time: 1, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } - + } stage ('Deploy to Dev Environment') { steps { build job: 'ansible-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'env', value: 'dev']], propagate: false, wait: true From 73f2f1f1392db8a60632325bfa4514004593d5d1 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 05:17:48 -0400 Subject: [PATCH 17/24] Edit --- Jenkinsfile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4948515f..ef65ac940 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,21 +52,6 @@ pipeline { plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'BB - Structure Objects', yaxis: 'Count' } } - - stage('SonarQube Quality Gate') { - when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - environment { - scannerHome = tool 'SonarQubeScanner' - } - steps { - withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - } - timeout(time: 1, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } stage ('Package Artifact') { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' @@ -86,7 +71,23 @@ pipeline { server.upload(uploadSpec) } } - } + } + + stage('SonarQube Quality Gate') { + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { + scannerHome = tool 'SonarQubeScanner' + } + steps { + withSonarQubeEnv('sonarqube') { + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" + } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } + } + } + stage ('Deploy to Dev Environment') { steps { build job: 'ansible-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'env', value: 'dev']], propagate: false, wait: true From c7f16e6ce227fe04bc8862746ada20d1ad7faf71 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 05:19:54 -0400 Subject: [PATCH 18/24] modified Jenkinsfile --- Jenkinsfile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef65ac940..b81fe549a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,6 +52,21 @@ pipeline { plot csvFileName: 'plot-396c4a6b-b573-41e5-85d8-73613b2ffffb.csv', csvSeries: [[displayTableFlag: false, exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants', file: 'build/logs/phploc.csv', inclusionFlag: 'INCLUDE_BY_STRING', url: '']], group: 'phploc', numBuilds: '100', style: 'line', title: 'BB - Structure Objects', yaxis: 'Count' } } + + stage('SonarQube Quality Gate') { + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { + scannerHome = tool 'SonarQubeScanner' + } + steps { + withSonarQubeEnv('sonarqube') { + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" + } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } + } + } stage ('Package Artifact') { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' @@ -72,22 +87,6 @@ pipeline { } } } - - stage('SonarQube Quality Gate') { - when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - environment { - scannerHome = tool 'SonarQubeScanner' - } - steps { - withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - } - timeout(time: 1, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } - stage ('Deploy to Dev Environment') { steps { build job: 'ansible-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'env', value: 'dev']], propagate: false, wait: true From b505616cad777f65556c5be572ced430af1df4f7 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 26 Aug 2021 05:24:07 -0400 Subject: [PATCH 19/24] Update --- Jenkinsfile | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 06b4f1b9e..d789c536d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,21 +87,6 @@ pipeline { } } } - - stage('SonarQube Quality Gate') { - when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - environment { - scannerHome = tool 'SonarQubeScanner' - } - steps { - withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - } - timeout(time: 1, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } stage ('Deploy to Dev Environment') { steps { From e6688606a5fafb70fc7820431876d39e6c7b23dc Mon Sep 17 00:00:00 2001 From: realayo Date: Mon, 20 Sep 2021 01:50:07 -0400 Subject: [PATCH 20/24] update --- Jenkinsfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d789c536d..bd366a798 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,20 +53,20 @@ pipeline { } } - stage('SonarQube Quality Gate') { - when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - environment { - scannerHome = tool 'SonarQubeScanner' - } - steps { - withSonarQubeEnv('sonarqube') { - sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - } - timeout(time: 1, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } + // stage('SonarQube Quality Gate') { + // when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + // environment { + // scannerHome = tool 'SonarQubeScanner' + // } + // steps { + // withSonarQubeEnv('sonarqube') { + // sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" + // } + // timeout(time: 1, unit: 'MINUTES') { + // waitForQualityGate abortPipeline: true + // } + // } + // } stage ('Package Artifact') { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' From a9843bcc878a79e0b0e19dffdfec5d128fd0ec97 Mon Sep 17 00:00:00 2001 From: realayo Date: Wed, 22 Sep 2021 14:32:02 +0100 Subject: [PATCH 21/24] update --- .env.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 35a39d7ae..b1bc785ba 100644 --- a/.env.sample +++ b/.env.sample @@ -3,7 +3,7 @@ APP_DEBUG=true APP_KEY=SomeRandomString APP_URL=http://localhost -DB_HOST=172.31.3.135 +DB_HOST=172.31.27.157 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=sePret^i From 39314a4de9bdaeed5d989ae222fbe8d642386633 Mon Sep 17 00:00:00 2001 From: realayo Date: Wed, 22 Sep 2021 14:40:10 +0100 Subject: [PATCH 22/24] update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd366a798..b21fdf65e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,7 +75,7 @@ pipeline { stage ('Deploy Artifact') { steps { script { - def server = Artifactory.server 'Artifactory' + def server = Artifactory.server 'artifactory-server' def uploadSpec = """{ "files": [{ "pattern": "php-todo.zip", From 7bec2bd8a6ed20631bd995469bd1181a9b4e13e9 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 23 Sep 2021 13:01:46 +0100 Subject: [PATCH 23/24] update --- Jenkinsfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b21fdf65e..8a67ce111 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,20 +53,20 @@ pipeline { } } - // stage('SonarQube Quality Gate') { - // when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} - // environment { - // scannerHome = tool 'SonarQubeScanner' - // } - // steps { - // withSonarQubeEnv('sonarqube') { - // sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" - // } - // timeout(time: 1, unit: 'MINUTES') { - // waitForQualityGate abortPipeline: true - // } - // } - // } + stage('SonarQube Quality Gate') { + // when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + environment { + scannerHome = tool 'SonarQubeScanner' + } + steps { + withSonarQubeEnv('sonarqube') { + sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" + } + // timeout(time: 1, unit: 'MINUTES') { + // waitForQualityGate abortPipeline: true + // } + } + } stage ('Package Artifact') { steps { sh 'zip -qr ${WORKSPACE}/php-todo.zip ${WORKSPACE}/*' From 12eb92e7fc92e9dc702759245dd74f12000e2260 Mon Sep 17 00:00:00 2001 From: realayo Date: Thu, 23 Sep 2021 13:26:16 +0100 Subject: [PATCH 24/24] update --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8a67ce111..144838b32 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,7 +54,7 @@ pipeline { } stage('SonarQube Quality Gate') { - // when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} + when { branch pattern: "^develop*|^hotfix*|^release*|^main*", comparator: "REGEXP"} environment { scannerHome = tool 'SonarQubeScanner' } @@ -62,9 +62,9 @@ pipeline { withSonarQubeEnv('sonarqube') { sh "${scannerHome}/bin/sonar-scanner -Dproject.settings=sonar-project.properties" } - // timeout(time: 1, unit: 'MINUTES') { - // waitForQualityGate abortPipeline: true - // } + timeout(time: 1, unit: 'MINUTES') { + waitForQualityGate abortPipeline: true + } } } stage ('Package Artifact') {