Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Manoa Ratefiarison
ISPConfig 3
Commits
22819ea8
Commit
22819ea8
authored
4 years ago
by
Marius Burkard
Browse files
Options
Downloads
Patches
Plain Diff
- added custom ci lint script
parent
20e52c33
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.git-scripts/syntax.sh
+56
-0
56 additions, 0 deletions
.git-scripts/syntax.sh
.gitlab-ci.yml
+31
-3
31 additions, 3 deletions
.gitlab-ci.yml
with
87 additions
and
3 deletions
.git-scripts/syntax.sh
0 → 100644
+
56
−
0
View file @
22819ea8
#!/bin/bash
IFS
=
$'
\n
'
EX
=
0
ERRS
=
""
;
WARNS
=
""
;
ERRCNT
=
0
;
WARNCNT
=
0
;
CMD
=
"find . -type f
\(
-name
\"
*.php
\"
-o -name
\"
*.lng
\"
\)
-print"
;
if
[[
"
$1
"
==
"commit"
]]
;
then
CMD
=
"git diff-tree --no-commit-id --name-only -r
${
CI_COMMIT_SHA
}
| grep -E '
\.
(php|lng)
$'
"
;
fi
for
F
in
$(
eval
"
$CMD
"
)
;
do
if
[[
!
-e
"
${
F
}
"
&&
-f
"
${
F
}
"
]]
;
then
continue
;
fi
echo
-n
"
${
F
}
... "
;
R
=
$(
php
-d
error_reporting
=
E_ALL
-d
display_errors
=
On
-l
"
$F
"
2>/dev/null
)
;
RET
=
$?
;
R
=
$(
echo
"
${
R
}
"
|
sed
"/^
$/
d"
)
if
[
$RET
-gt
0
]
;
then
EX
=
1
;
echo
"[ERROR]"
;
ERRS
=
"
${
ERRS
}${
F
}
:"
$'
\n
'
"
${
R
}
"
$'
\n\n
'
;
ERRCNT
=
$((
ERRCNT
+
1
))
;
else
if
[[
"
$R
"
==
"Deprecated: "
*
]]
;
then
echo
"[WARN]"
;
WARNS
=
"
${
WARNS
}${
F
}
:"
$'
\n
'
"
${
R
}
"
$'
\n\n
'
;
WARNCNT
=
$((
WARNCNT
+
1
))
;
else
echo
"[OK]"
;
fi
fi
done
echo
""
echo
"--------------------------"
;
echo
""
echo
"
${
ERRCNT
}
Errors"
if
[
$ERRCNT
-gt
0
]
;
then
echo
"
${
ERRS
}
"
echo
""
fi
echo
"
${
WARNCNT
}
Warnings"
if
[
$WARNCNT
-gt
0
]
;
then
echo
""
echo
"
${
WARNS
}
"
echo
""
fi
exit
$EX
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
31
−
3
View file @
22819ea8
# Defines stages which are to be executed
stages
:
-
syntax
-
syntax_diff
#
### Stage syntax
...
...
@@ -16,8 +17,35 @@ syntax:lint:
-
merge_requests
script
:
-
composer require overtrue/phplint
-
echo "Syntax checking PHP files"
-
echo "For more information http://www.icosaedro.it/phplint/"
-
vendor/bin/phplint
-
bash ./.git-scripts/syntax.sh
syntax_diff:lint
:
stage
:
syntax
image
:
edbizarro/gitlab-ci-pipeline-php:7.2
allow_failure
:
false
only
:
-
web
-
pushes
-
branches
script
:
-
echo "Syntax checking PHP files"
-
bash ./.git-scripts/syntax.sh commit
#syntax:lint:
# stage: syntax
# image: edbizarro/gitlab-ci-pipeline-php:7.2
# allow_failure: false
# only:
# - schedules
# - web
# - merge_requests
#
# script:
# - composer require overtrue/phplint
# - echo "Syntax checking PHP files"
# - echo "For more information http://www.icosaedro.it/phplint/"
# - vendor/bin/phplint
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment