Commit b9137815 authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

Fixed the CI/CD pipeline and fixed a small issue with the log

parent 84fe943e
Pipeline #1324 passed with stage
in 13 minutes and 59 seconds
......@@ -4,7 +4,7 @@ stages:
- deploy
default:
image: centos:latest
image: centos:8
centos test:
before_script:
......@@ -22,7 +22,7 @@ centos test:
when: on_failure
debian test:
image: debian:latest
image: debian:10
before_script:
- apt-get update
- apt-get install -y netcat
......
......@@ -212,7 +212,7 @@ autoMode() {
if ! nc -w 1 -z "${HOST}" 22 &> /dev/null;then
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: ${HOST}:22 is unreachable, please check your connection" >> "$LOGFILE"
echo "[$(date +"%T")] local.ERROR: ${HOST}:22 is unreachable, please check your connection" >> "$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: ${HOST}:22 is unreachable, please check your connection" >> "$ERRORLOGFILE"
fi
if [[ "$*" == *--local* ]] || [[ "$*" == *-L* ]]; then
......@@ -246,7 +246,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$ERRORLOGFILE"
fi
else
ARCHIVENAME=$(date +"%Y%m%d%H%M")
......@@ -258,7 +258,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$ERRORLOGFILE"
fi
fi
......@@ -276,7 +276,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$ERRORLOGFILE"
fi
fi
......@@ -300,7 +300,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Compression of $DIRECTORY failed" >> "../$ERRORLOGFILE"
fi
else
ARCHIVENAME=$(date +"%Y%m%d%H%M")
......@@ -312,7 +312,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Compression of $ARCHIVENAME failed" >> "../$ERRORLOGFILE"
fi
fi
......@@ -330,7 +330,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$ERRORLOGFILE"
fi
fi
done
......@@ -360,7 +360,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Hashing of $FILE failed" >> "../../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Hashing of $FILE failed" >> "../../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Hashing of $FILE failed" >> "../../$ERRORLOGFILE"
fi
if [ -f "$FILE.gpg" ]; then
......@@ -369,7 +369,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Encryption of $FILE failed" >> "../../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Encryption of $FILE failed" >> "../../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Encryption of $FILE failed" >> "../../$ERRORLOGFILE"
fi
if [[ "$*" == *--local* ]] || [[ "$*" == *-L* ]]; then
......@@ -415,7 +415,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Hashing of $FILE failed" >> "../../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Hashing of $FILE failed" >> "../../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Hashing of $FILE failed" >> "../../$ERRORLOGFILE"
fi
if [ -f "$FILE.gpg" ]; then
......@@ -424,7 +424,7 @@ autoMode() {
((ERRORS=ERRORS+1))
((STEP_ERRORS=STEP_ERRORS+1))
echo "[$(date +"%T")] local.ERROR: Encryption of $FILE failed" >> "../../$LOGFILE"
echo "[$(date +"%T")] local.ERROR: Encryption of $FILE failed" >> "../../$ERRORLOGFILE"
echo "[$(date +"%F %T")] local.ERROR: Encryption of $FILE failed" >> "../../$ERRORLOGFILE"
fi
if [[ "$*" == *--local* ]] || [[ "$*" == *-L* ]]; then
......@@ -467,7 +467,7 @@ autoMode() {
if [[ $ERRORS > 0 ]]; then
printf "${BACK_RED} ERROR ${COL_RESET} ${COL_RED}Completed with $ERRORS error(s)${COL_RESET} ${COL_GREY} ${TIME} ${COL_RESET}\n"
printf "${BACK_RED} error ${COL_RESET} Missing files: Error detected please check ./$LOGFILE\n"
printf "${BACK_RED} error ${COL_RESET} Missing files: Error detected please check ./$ERRORLOGFILE\n"
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