Commit 1844ef69 authored by Lucas's avatar Lucas
Browse files

SCRUM#512: Add lint stage in CI runner

parent aa2c66fa
Pipeline #16526 failed with stages
in 39 seconds
## Template para empacotamento utilizando o Gitlab-ci.
stages:
- lint
- build
- test
- deploy
lint_shell:
stage: lint
tags:
- debian-packaging
script:
- ./.linter_shell.sh
lint_python:
stage: lint
tags:
- debian-packaging
script:
- apt-get update
- apt-get install python3-pip -y
- pip3 install -r py_linter_requirements.txt
- ./.linter_python.sh
build_amd64:
stage: build
artifacts:
......
#!/bin/bash
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
py_files=$(find -name "*.py")
exe_files=$(grep -Erl "#\!/usr/bin/python*" --exclude=*.* package)
files="$py_files\n$exe_files"
#find no files
if [[ "$files" == "\n" ]];then
echo -e "${YELLOW}No python files found!${NC}"
exit 0
fi
echo -e "$files" | xargs flake8
if [[ $? -eq 0 ]];then
echo "AWESOME!No problems found."
exit 0
else
echo -e "Understand errors in: ${BLUE}http://flake8.pycqa.org/en/latest/user/error-codes.html${NC}"
exit 1
fi
#!/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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment