Skip to content
Snippets Groups Projects
Commit 943ed6c2 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: added comments and minor clean up to .gitlab-ci.yml

parent fad8cfaa
No related branches found
No related tags found
1 merge request!33MAINT: comments and minor clean up
Pipeline #21403 failed
...@@ -92,7 +92,6 @@ test: ...@@ -92,7 +92,6 @@ test:
image: $CI_REGISTRY_IMAGE_BASE image: $CI_REGISTRY_IMAGE_BASE
needs: ["cert"] needs: ["cert"]
script: script:
- ls /
- echo $F_BRANCH - echo $F_BRANCH
- echo $CAOSDB_TAG - echo $CAOSDB_TAG
- echo $CI_COMMIT_REF_NAME - echo $CI_COMMIT_REF_NAME
...@@ -112,7 +111,6 @@ test: ...@@ -112,7 +111,6 @@ test:
- echo $CI_REGISTRY_IMAGE - echo $CI_REGISTRY_IMAGE
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- time docker load < /image-cache/caosdb-${F_BRANCH}.tar || true
- if [[ "$CAOSDB_TAG" == "" ]]; then - if [[ "$CAOSDB_TAG" == "" ]]; then
if echo "$F_BRANCH" | grep -c "^f-" ; then if echo "$F_BRANCH" | grep -c "^f-" ; then
CAOSDB_TAG=${DEPLOY_REF}_F_${F_BRANCH}; CAOSDB_TAG=${DEPLOY_REF}_F_${F_BRANCH};
...@@ -121,30 +119,47 @@ test: ...@@ -121,30 +119,47 @@ test:
CAOSDB_TAG=${DEPLOY_REF}; CAOSDB_TAG=${DEPLOY_REF};
fi; fi;
fi fi
- docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=dev ;
- echo $CAOSDB_TAG - echo $CAOSDB_TAG
- cd .docker
# Store mariadb version
- MARIADBVERSION=$(grep mariadb docker-compose.yml | awk '{print $2}')
- echo "mariadb image:"$MARIADBVERSION
- time docker load < /image-cache/caosdb-pyint-testenv-${CI_COMMIT_REF_NAME}.tar || true - time docker load < /image-cache/caosdb-pyint-testenv-${CI_COMMIT_REF_NAME}.tar || true
- time docker load < /image-cache/mariadb.tar || true - time docker load < /image-cache/caosdb-${F_BRANCH}.tar || true
- time docker load < /image-cache/$MARIADBVERSION.tar || true
- docker pull $CI_REGISTRY_IMAGE - docker pull $CI_REGISTRY_IMAGE
- cd .docker - docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=dev ;
# here the server and the mysql backend docker are being started
# Here, the server and the mysql backend docker are being started
- CAOSDB_TAG=$CAOSDB_TAG docker-compose up -d - CAOSDB_TAG=$CAOSDB_TAG docker-compose up -d
# store versions of CaosDB parts
# Store versions of CaosDB parts
- docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_pylib_commit > hash_pylib - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_pylib_commit > hash_pylib
- docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_webui_commit > hash_webui - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_webui_commit > hash_webui
- docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_server_commit > hash_server - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_server_commit > hash_server
- docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_mysqlbackend_commit > hash_mysql - docker exec -u 0 -t docker_caosdb-server_1 cat /opt/caosdb/git/caosdb_mysqlbackend_commit > hash_mysql
# the pyinttest docker writes the return value of the tests into the
# file result # Run the actual tests. This starts a new docker container within which
# the tests run. The return value is stored in .docker/result
- /bin/sh ./run.sh - /bin/sh ./run.sh
# Save logs
- docker logs docker_caosdb-server_1 &> ../caosdb_log.txt - docker logs docker_caosdb-server_1 &> ../caosdb_log.txt
- docker logs docker_sqldb_1 &> ../mariadb_log.txt - docker logs docker_sqldb_1 &> ../mariadb_log.txt
- cd .. - cd ..
# Stop the server
- docker-compose -f .docker/docker-compose.yml down - docker-compose -f .docker/docker-compose.yml down
# Store mariadb image
- if [ ! -f ".gistlab-ci.yml" ]; then
time docker save $MARIADBVERSION > /image-cache/$MARIADBVERSION.tar || true
fi
# the pyinttest docker writes the return value of the tests into the
# file result
- rc=`cat .docker/result` - rc=`cat .docker/result`
- echo mariadb:$(docker image ls mariadb | grep mariadb | awk '{print $2}')
- docker save mariadb:$(docker image ls mariadb | grep mariadb | awk '{print $2}') > /image-cache/mariadb.tar || true
- exit $rc - exit $rc
dependencies: [cert] dependencies: [cert]
timeout: 3h timeout: 3h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment