Skip to content
Snippets Groups Projects
Verified Commit 1fdbb5a2 authored by David Beniamine's avatar David Beniamine
Browse files

Improve ci-job lisibility

parent c6726b95
No related branches found
No related tags found
1 merge request!25Add a gitlab-ci file
#!/bin/bash
#!/bin/bash
DIR=$(realpath $(dirname $0))
docker login registry.gitlab.tetras-libre.fr
docker build -t registry.gitlab.tetras-libre.fr/rekall/memorekall-member-new $DIR/docker/symfony
docker push registry.gitlab.tetras-libre.fr/rekall/memorekall-member-new
#!/bin/bash
exit_on_fail(){
if [ $1 -ne 0 ];
REDBOLD='\033[0;31;1m'
GREENBOLD='\033[0;32;1m'
BOLD='\033[1m'
NORMAL='\033[0m'
run_step(){
name=$1
shift
echo -e "${BOLD} Running step : $name ${NORMAL}"
$@
ret=$?
if [ $ret -ne 0 ];
then
echo "Failed $2"
exit $1
echo -e "${REDBOLD}$name failed${NORMAL}"
exit $ret
else
echo -e "${GREENBOLD}$name sucess${NORMAL}"
fi
}
composer install
exit_on_fail $? "PHP dependencies"
npm install
exit_on_fail $? "Javascript dependencies"
npm run dev
exit_on_fail $? "Building assets"
composer ci
exit_on_fail $? "Tests"
run_step "PHP dependencies" composer install
run_step "Javascript dependencies" npm install
run_step "Assets compilation" npm run dev
run_step "Unit and functional tests" composer tests
run_step "Php Code Sniffer" composer phpcs
run_step "Php Static analysis" composer phpstan
run_step "Javascript ESLint" npm run lint
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment