Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
le-autoupgrade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
le6
le-autoupgrade
Commits
57c58bad
There was a problem fetching the pipeline summary.
Commit
57c58bad
authored
6 years ago
by
André Machado
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/506' into 'develop'
SCRUM#506
: Add shell linter See merge request
!15
parents
aa8ec9cf
eeba8ffc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!25
Develop
,
!15
SCRUM#506: Add shell linter
Pipeline
#
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.build.sh
+6
-6
6 additions, 6 deletions
.build.sh
.deploy.sh
+4
-3
4 additions, 3 deletions
.deploy.sh
.gitlab-ci.yml
+8
-0
8 additions, 0 deletions
.gitlab-ci.yml
.linter_shell.sh
+23
-0
23 additions, 0 deletions
.linter_shell.sh
with
41 additions
and
9 deletions
.build.sh
+
6
−
6
View file @
57c58bad
...
...
@@ -6,13 +6,13 @@ apt-get update && apt-get install -y devscripts
CHANGELOG
=
"package/debian/changelog"
LINE
=
$(
head
-n
1
$CHANGELOG
)
PACKAGE
=
$(
echo
$LINE
|
cut
-d
' '
-f1
)
VERSION
=
$(
echo
$LINE
|
cut
-d
' '
-f2
|
grep
-o
-E
'[0-9]*\.[0-9]*\.[0-9]*'
)
tar
--exclude
=
debian
-czf
${
PACKAGE
}
_
${
VERSION
}
.orig.tar.gz package/
*
PACKAGE
=
$(
echo
"
$LINE
"
|
cut
-d
' '
-f1
)
VERSION
=
$(
echo
"
$LINE
"
|
cut
-d
' '
-f2
|
grep
-o
-E
'[0-9]*\.[0-9]*\.[0-9]*'
)
tar
--exclude
=
debian
-czf
"
${
PACKAGE
}
"
_
"
${
VERSION
}
"
.orig.tar.gz package/
*
cd
package
cd
package
||
exit
-1
debuild
-us
-uc
cd
../
cd
../
||
exit
-1
mkdir
build/
mv
${
PACKAGE
}*
build/
mv
"
${
PACKAGE
}
"
*
build/
This diff is collapsed.
Click to expand it.
.deploy.sh
+
4
−
3
View file @
57c58bad
...
...
@@ -5,7 +5,7 @@
apt-get update
&&
apt-get
install
-y
dput ssh
eval
$(
ssh-agent
-s
)
eval
"
$(
ssh-agent
-s
)
"
ssh-add <
(
echo
"
$PRIV_KEY
"
)
echo
"Deploy job name:
$CI_JOB_NAME
"
...
...
@@ -15,9 +15,10 @@ if [ "$CI_JOB_NAME" = "deploy_for_testing" ]; then
elif
[
"
$CI_JOB_NAME
"
=
"deploy_for_stable"
]
;
then
CHANGELOG
=
"package/debian/changelog"
LINE
=
$(
head
-n
1
$CHANGELOG
)
PACKAGE
=
$(
echo
$LINE
|
cut
-d
' '
-f1
)
VERSION
=
$(
echo
$LINE
|
cut
-d
' '
-f2
|
grep
-o
-E
'[0-9]*\.[0-9]*\.[0-9]*'
)
PACKAGE
=
$(
echo
"
$LINE
"
|
cut
-d
' '
-f1
)
VERSION
=
$(
echo
"
$LINE
"
|
cut
-d
' '
-f2
|
grep
-o
-E
'[0-9]*\.[0-9]*\.[0-9]*'
)
REPREPRO_CMD
=
"reprepro -Vb /home/repository/www/le6 copysrc stable testing
$PACKAGE
$VERSION
"
# shellcheck disable=SC2029
ssh
-o
StrictHostKeyChecking
=
no
-i
~/.ssh/id_rsa repository@repo.c3sl.ufpr.br
"
$REPREPRO_CMD
"
fi
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
8
−
0
View file @
57c58bad
## Template para empacotamento utilizando o Gitlab-ci.
stages
:
-
lint
-
build
-
test
-
deploy
lint_shell
:
stage
:
lint
tags
:
-
debian-packaging
script
:
-
./.linter_shell.sh
build
:
stage
:
build
artifacts
:
...
...
This diff is collapsed.
Click to expand it.
.linter_shell.sh
0 → 100755
+
23
−
0
View file @
57c58bad
#!/bin/bash
YELLOW
=
'\033[0;33m'
BLUE
=
'\033[0;34m'
NC
=
'\033[0m'
# No Color
sh_files
=
$(
find
-name
"*.sh"
)
exe_files
=
$(
grep
-Erl
"#
\!
/bin/(bash|sh)"
--exclude
=
*
.
*
package
)
files
=
"
$sh_files
\n
$exe_files
"
#find no files
if
[[
"
$files
"
==
"
\n
"
]]
;
then
echo
-e
"
${
YELLOW
}
No shell files found!
${
NC
}
"
exit
0
fi
echo
-e
"
$files
"
| xargs shellcheck
-s
bash
if
[[
$?
-eq
0
]]
;
then
echo
"AWESOME!No problems found."
exit
0
else
echo
-e
"Understand errors in:
${
BLUE
}
https://github.com/koalaman/shellcheck/wiki
${
NC
}
"
exit
1
fi
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