Commit e4ab7a1e authored by Bùi Bá Trường's avatar Bùi Bá Trường

truongbb - test ci

parent 4525730d
Pipeline #494 passed with stages
in 2 minutes and 15 seconds
TAG=latest
IMAGE_TYPE=dev
IMAGE_REGISTRY_URL=192.168.1.204:8083
DOCKER_STAGING_REGISTRY=192.168.1.204:8083
PROJECT_VERSION=0.0.1-SNAPSHOT
JDK_BASE_IMAGE=adoptopenjdk/openjdk11:latest
PROJECT_CODE=itsol-ci
......@@ -8,7 +8,7 @@ sub_help(){
echo "Usage: $cmd <sub-command> [options]"
echo "Sub-commands:"
echo " help Show help"
echo " checkout Checkout code from git"
echo " checkout-code Checkout code from git"
echo " compile Compile java code"
echo " sonar-scan Run sonar scanner"
echo " quality-gate Check quality gate"
......@@ -21,7 +21,7 @@ sub_help(){
echo ""
}
sub_checkout(){
sub_checkout-code(){
# -------------CLONE-----------------
# cd /root/GitlabRunner/repo/
# rm -rf ./spring-ci-advanced
......@@ -40,7 +40,6 @@ sub_compile(){
}
sub_sonar-scan(){
# /root/sonar-scanner/bin/sonar-scanner
rm -rf ./target/*
mvn clean --settings settings.xml package sonar:sonar \
-Dsonar.projectName='SpringCIAdvanced' \
......@@ -109,6 +108,7 @@ _docker_mvn() {
sub_package() {
_docker_mvn package -DskipTests
}
sub_setup() {
echo "Setup host for deploying app, require sudo privileges"
......
......@@ -10,10 +10,10 @@ import java.util.List;
public class StudentRepositoryImpl implements StudentRepository {
@Override
public List<Student> getAll() {
try {
int a = 1 / 0;
} catch (Exception e) {
}
// try {
// int a = 1 / 0;
// } catch (Exception e) {
// }
return Arrays.asList(new Student(1, "Nguyen Van 1", "Ha Noi 1"),
new Student(1, "Nguyen Van 2", "Ha Noi 2"),
......
......@@ -2,7 +2,7 @@
# stop pipeline if QUALITY GATE is FAIL
if [[ $QUALITY_GATE = "NOK" ]]
if [[ ${QUALITY_GATE} = "NOK" ]]
then
echo "QUALITY GATE FAILED. CHECK SONAR SCANNER RESULT!"
export QUALITY_GATE="OK"
......
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