diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1ef5eb2b28502bf7a0af6a6230ec38c280515a3..6f9eddf15897c200164e2375a04ef7c15af645e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ build-master: - docker pull "$IMAGE_6":latest || true - docker build --cache-from "$IMAGE_6":latest -t "$IMAGE_6":latest -t "$IMAGE_6":$VERSION_6 ingestor/ - cd ./testing && ./gitlab_test.sh - - if [ $? -ne 0 ]; then echo "fail" && exit 1; fi + - if [ $? -ne 0 ]; then exit 1; fi # actually fail build - docker push "$IMAGE_1":$VERSION_1 - docker push "$IMAGE_1":latest - docker push "$IMAGE_2":$VERSION_2 diff --git a/testing/gitlab_test.sh b/testing/gitlab_test.sh index ad7ecafb6195d3fb301d25854ea631859f2436c0..33ffa61eda2d0029fb8f943b826a20e22c4c0625 100755 --- a/testing/gitlab_test.sh +++ b/testing/gitlab_test.sh @@ -46,14 +46,8 @@ docker service ls bash ./registrar_test.sh product_list.csv -if [ $? -eq 0 ] -then - echo "Script success" - exit 0 -else - echo "Script fail" - exit 1 -fi +if [ $? -ne 0 ]; then exit 1; fi + # docker exec -i $(docker ps -qf "name=emg-pvs_registrar") python3 /var/www/pvs/dev/pvs_instance/manage.py storage create pvs_testing pvs_testing --type swift --storage-auth auth-cloud-ovh # docker exec -i $(docker ps -qf "name=emg-pvs_registrar") python3 /core/registrar.py --objects-prefix "OA/PH1B/0.1/b9/urn:eop:PHR:MULTISPECTRAL_0.5m:DS_PHR1B_201608070959189_FR1_PX_E012N32_0719_00974_4148/0000/PH1B_PHR_FUS_1A_20160807T095918_20160807T095920_TOU_1234_4148.DIMA.tar" # pytest -s registrar_test.py --name OA/PH1B/0.1/b9/urn:eop:PHR:MULTISPECTRAL_0.5m:DS_PHR1B_201608070959189_FR1_PX_E012N32_0719_00974_4148/0000/PH1B_PHR_FUS_1A_20160807T095918_20160807T095920_TOU_1234_4148.DIMA.tar diff --git a/testing/registrar_test.sh b/testing/registrar_test.sh index f993e801bb282fdca231bdc226da65f518f252f6..70e750cf82248d8699064086e1a7c949ab5b2a8a 100755 --- a/testing/registrar_test.sh +++ b/testing/registrar_test.sh @@ -14,12 +14,4 @@ while read product; do done < "$product_list_file" pytest - -if [ $? -eq 0 ] -then - echo "Pytest success" - exit 0 -else - echo "Pytest fail" >&2 - exit 1 -fi \ No newline at end of file +if [ $? -ne 0 ]; then echo "Pytest fail" >&2 && exit 1; fi \ No newline at end of file