diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9914acd4b0f0893e0856eaf58000581ec814912..44749ddf44db1039fdd2533537b3e21155cbf5fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,3 @@ -# SPSP Transfer Tool CI/CD stages: - test - deploy @@ -25,6 +24,8 @@ centos test: - logs/spsp*.log expire_in: 1 week when: on_failure + only: + - merge_requests debian test: image: debian:10 @@ -33,7 +34,6 @@ debian test: - apt-get install -y netcat - apt-get install -y gpg - apt-get install -y openssh-client - - apt-get install -y gpg - mkdir -p ~/.ssh - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 @@ -43,14 +43,39 @@ debian test: script: - ./spsp init --without-env - ./spsp test --without-env - inherit: - default: false artifacts: paths: - logs/error.log - logs/spsp*.log expire_in: 1 week when: on_failure + only: + - merge_requests + +ubuntu test: + image: ubuntu:20.04 + before_script: + - apt-get update + - apt-get install -y netcat + - apt-get install -y gnupg2 + - apt-get install -y openssh-client + - mkdir -p ~/.ssh + - echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_ed25519 + - chmod 600 ~/.ssh/id_ed25519 + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config + + stage: test + script: + - ./spsp init --without-env + - ./spsp test --without-env + artifacts: + paths: + - logs/error.log + - logs/spsp*.log + expire_in: 1 week + when: on_failure + only: + - merge_requests release: stage: deploy diff --git a/spsp b/spsp index d966b5eef27b5c68f1f1b29c3ae9f7d9b19e8cea..3e9c805337e38092ccbef417618ec3024034d198 100755 --- a/spsp +++ b/spsp @@ -2,7 +2,7 @@ # SPSP transfer-tool is developed and maintained by SIB. For more information, please contact spsp-support@sib.swiss -VERSION="1.6.0" # bumped to support spsp --help, spsp --version +VERSION="1.7.0" # bumped to support spsp --help, spsp --version # Define colors that are used in the help screen @@ -234,7 +234,7 @@ autoMode() { if [ -d "$DIRECTORY" ] && [ "$DIRECTORY" != $OUTBOX ] && [ "$DIRECTORY" != $SENT ] && [ "$DIRECTORY" != $LOGS ]; then - if ls "$DIRECTORY"/*.fastq* 1> /dev/null 2>&1 && ls "$DIRECTORY"/*.xlsx 1> /dev/null 2>&1; then + if ls "$DIRECTORY"/*.fast* 1> /dev/null 2>&1 && ls "$DIRECTORY"/*.xlsx 1> /dev/null 2>&1; then if [[ "$*" == *--fake* ]] || [[ "$*" == *-F* ]]; then compressFolder "$DIRECTORY" @@ -273,8 +273,8 @@ autoMode() { else ((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 +"%F %T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$ERRORLOGFILE" + echo "[$(date +"%T")] local.ERROR: Missing files (*.fasta/.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$LOGFILE" + echo "[$(date +"%F %T")] local.ERROR: Missing files (*.fasta/.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $VIRUSES DIRECTORY" >> "../$ERRORLOGFILE" fi fi @@ -288,7 +288,7 @@ autoMode() { if [ -d "$DIRECTORY" ] && [ "$DIRECTORY" != $OUTBOX ] && [ "$DIRECTORY" != $SENT ] && [ "$DIRECTORY" != $LOGS ]; then - if ls "$DIRECTORY"/*.fastq* 1> /dev/null 2>&1 && ls "$DIRECTORY"/*.xlsx 1> /dev/null 2>&1; then + if ls "$DIRECTORY"/*.fast* 1> /dev/null 2>&1 && ls "$DIRECTORY"/*.xlsx 1> /dev/null 2>&1; then if [[ "$*" == *--fake* ]] || [[ "$*" == *-F* ]]; then compressFolder "$DIRECTORY" @@ -327,8 +327,8 @@ autoMode() { else ((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 +"%F %T")] local.ERROR: Missing files (*.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$ERRORLOGFILE" + echo "[$(date +"%T")] local.ERROR: Missing files (*.fasta/.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$LOGFILE" + echo "[$(date +"%F %T")] local.ERROR: Missing files (*.fasta/.fastq/.fastq.gz and/or *.xlsx) inside $DIRECTORY of $BACTERIA DIRECTORY" >> "../$ERRORLOGFILE" fi fi done @@ -494,9 +494,15 @@ generateFakeFiles() { rm -rf ./$VIRUSES/fake-viruses/* truncate -s 5M ./$VIRUSES/fake-viruses/fake-viruses.xlsx - for i in {1..10}; do + for i in {1..3}; do truncate -s 1G ./$VIRUSES/fake-viruses/fake-virus${i}.fastq.gz done + for i in {1..3}; do + truncate -s 1G ./$VIRUSES/fake-viruses/fake-virus${i}.fastq + done + for i in {1..3}; do + truncate -s 1G ./$VIRUSES/fake-viruses/fake-virus${i}.fasta + done if [ ! -d "$BACTERIA/fake-bacteria" ]; then mkdir -p $BACTERIA/fake-bacteria @@ -505,9 +511,15 @@ generateFakeFiles() { rm -rf ./$BACTERIA/fake-bacteria/* truncate -s 5M ./$BACTERIA/fake-bacteria/bacteria.xlsx - for i in {1..10}; do + for i in {1..3}; do truncate -s 1G ./$BACTERIA/fake-bacteria/bacteria${i}.fastq.gz done + for i in {1..3}; do + truncate -s 1G ./$BACTERIA/fake-bacteria/bacteria${i}.fastq + done + for i in {1..3}; do + truncate -s 1G ./$BACTERIA/fake-bacteria/bacteria${i}.fasta + done autoMode --fake --no-archive