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

truongbb - test ci

parent 9107365d
Pipeline #346 failed with stages
in 22 seconds
......@@ -14,6 +14,7 @@ before_script:
stages:
- checkout
- compile
- build
- send_email
......@@ -31,24 +32,25 @@ checkout:
- git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/spring-ci-advanced.git
- cd ./spring-ci-advanced
compile:
stage: compile
only:
- master
# - merge_requests
script:
- cd /root/GitlabRunner/repo/spring-ci-advanced
- ls
- chmod +x ./build-test.sh
- ./build-test.sh compile
build:
stage: build
only:
- master
# - merge_requests
script:
# - ls # test command
# - cd /root/GitlabRunner/repo/
# - ls
# - rm -rf ./spring-ci
# - git config --global user.name 'truongbb96'
# - git config --global user.email 'truongbb@itsol.vn'
# - git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/spring-ci.git
# - cd ./spring-ci
- cd /root/GitlabRunner/repo/spring-ci-advanced
- ls
- chmod +x ./build-test.sh
- ./build-test.sh demo
send_email:
stage: send_email
......
......@@ -24,7 +24,6 @@ sub_demo(){
sub_checkout(){
echo "--------------CHECKING OUT GIT CODE--------------------"
ls # test command
cd /root/GitlabRunner/repo/
ls
rm -rf ./spring-ci-advanced
......@@ -35,6 +34,43 @@ sub_checkout(){
echo "--------------DONE CHECKING OUT GIT CODE--------------------"
}
sub_compile(){
cd /root/GitlabRunner/repo/
ls
# mvn install
module=''
if [[ -z $1 ]]; then
echo "Compiling for all modules in project"
elif [[ -n $1 ]]; then
module='-am -pl '$1
echo "Compiling for module" $1
fi
_docker_mvn compile ${module} -DskipTests
echo "DONE!"
}
sub_sonar-scan(){
cd /root/GitlabRunner/repo
ls
/root/sonar-scanner/bin/sonar-scanner
}
sub_send-email(){
}
_docker_mvn() {
docker run -i --rm \
-v "$PWD:/usr/src/" \
-v "$HOME/.m2:/root/.m2" \
-w /usr/src/ \
maven:oracle-jdk-11 \
mvn --settings .settings.xml -U clean $@
}
subcommand=$1
case $subcommand in
......
version: '3.2'
volumes:
gnoc_logs: {}
od-temp:
driver: local
driver_opts:
type: none
device: ${GNOC_TEMP_MOUNT_LOCATION}/${GNOC_OD_TEMP_FOLDER}
o: bind
od-upload:
driver: local
driver_opts:
type: none
device: ${GNOC_UPLOAD_MOUNT_LOCATION}/${GNOC_OD_UPLOAD_FOLDER}
o: bind
services:
od-service:
build:
context: ../od-service
args:
PROJECT_VERSION: ${PROJECT_VERSION}
JDK_BASE_IMAGE: ${JDK_BASE_IMAGE}
image: "${IMAGE_REGISTRY_URL}/${PROJECT_CODE}/${IMAGE_TYPE}/od-service:${TAG}"
container_name: "od-service"
network_mode: "host"
volumes: ['gnoc_logs:/app/log','od-temp:/app/od-temp','od-upload:/app/od-upload']
environment:
TZ: "Asia/Ho_Chi_Minh"
# depends_on:
# - configuration-service
# - discovery-service
# - hazelcast-server
restart: always
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