Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
22ba90c
added jenkinsfile
citadelict Jun 23, 2024
c11f615
new env file
citadelict Jun 23, 2024
1ad3007
updated jenkinsfile
citadelict Jun 23, 2024
8bb9628
plot
citadelict Jun 23, 2024
fadbf79
storage
citadelict Jun 23, 2024
35ab029
storage and logs
citadelict Jun 23, 2024
52dd1a3
learn
citadelict Jun 23, 2024
39bda8f
Delete storage directory
citadelict Jun 23, 2024
faddf6a
Create .file
citadelict Jun 23, 2024
847debb
Create .gitignore
citadelict Jun 23, 2024
620c9b3
Create .gitignore
citadelict Jun 23, 2024
051f53d
Delete storage/framework/cache/storage/framework directory
citadelict Jun 23, 2024
dee00e6
Create laravel.log
citadelict Jun 23, 2024
06ddfbd
Create .p
citadelict Jun 23, 2024
2d4e8df
Create .c
citadelict Jun 23, 2024
aa684c2
Create .s
citadelict Jun 23, 2024
f7cbd18
Create .v
citadelict Jun 23, 2024
9d38eb3
ready for deployment
citadelict Jun 23, 2024
24845b5
final prep
citadelict Jun 23, 2024
d01201c
Update Jenkinsfile
citadelict Jun 23, 2024
5131b8c
Merge branch 'main' of https://github.com/citadelict/php-todo into sa…
citadelict Jun 23, 2024
1cd4c13
deployed correction
citadelict Jun 23, 2024
ee87405
Update Jenkinsfile
citadelict Jun 23, 2024
e757c6d
Merge branch 'main' of https://github.com/citadelict/php-todo into sa…
citadelict Jun 23, 2024
7a1f0d1
commit new
citadelict Jun 23, 2024
60c1ffe
Update Jenkinsfile
citadelict Jun 23, 2024
248f165
Merge branch 'main' of https://github.com/citadelict/php-todo into sa…
citadelict Jun 23, 2024
46d0735
new
citadelict Jun 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost

DB_HOST=172.31.24.250
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=sePret^i

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
92 changes: 92 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
pipeline {
agent any

stages {
stage('Initial Cleanup') {
steps {
deleteDir()
}
}

stage('Checkout SCM') {
steps {
git branch: 'main', url: 'https://github.com/citadelict/php-todo.git'
}
}

stage('Prepare Dependencies') {
steps {
sh 'mv .env.sample .env'
sh 'mkdir -p bootstrap/cache'
sh 'composer install'
sh 'php artisan migrate'
sh 'php artisan db:seed'
sh 'php artisan key:generate'
}
}

stage('Execute Unit Tests') {
steps {
sh './vendor/bin/phpunit'
}
}

stage('Code Analysis') {
steps {
sh 'phploc app/ --log-csv build/logs/phploc.csv'
}
}

stage('Plot Code Coverage Report') {
steps {
plot csvFileName: 'plot-loc.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-structures.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-avg-length.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-complexity.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-classes.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-methods.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-constants.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-testing.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-lloc.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-functions.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-objects.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 php-todo.zip ${WORKSPACE}/*'
}
}

stage('Upload Artifact to Artifactory') {
steps {
script {
def server = Artifactory.server 'artifactory-server'
def uploadSpec = """{
"files": [
{
"pattern": "php-todo.zip",
"target": "Todo-dev-local/php-todo",
"props": "type=zip;status=ready"
}
]
}"""
println "Upload Spec: ${uploadSpec}"
try {
server.upload spec: uploadSpec
println "Upload successful"
} catch (Exception e) {
println "Upload failed: ${e.message}"
}
}
}
}

stage('Deploy to Dev Environment') {
steps {
build job: 'ansibllle-config-mgt/main', parameters: [[$class: 'StringParameterValue', name: 'inventory', value: 'dev']], propagate: false, wait: true
}
}
}
}
1 change: 1 addition & 0 deletions storage/app/.file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions storage/app/public/.p
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions storage/framework/cache/.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions storage/framework/sessions/.s
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions storage/framework/views/.v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions storage/logs/laravel.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@