Skip to content
Snippets Groups Projects
Verified Commit 89d5cc9f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: pipeline

parent 237b871b
No related branches found
No related tags found
No related merge requests found
Pipeline #8422 passed
......@@ -11,7 +11,10 @@ RUN cmake ..
RUN cmake --build .
RUN cmake --install . --prefix /usr/local/
WORKDIR /
COPY . /caosdb-cppinttest
WORKDIR /caosdb-cppinttest
RUN rm -rf .git
CMD ls -la && /wait-for-it.sh caosdb-server:10443 -t 500 -- \
# ... and run tests
ctest
......@@ -111,6 +111,7 @@ build-test:
tags: [ docker ]
stage: build
script:
- echo $PWD
- mkdir build
- cd build
- cmake -D CMAKE_PREFIX_PATH=/usr/local/lib/libcaosdb-${CPPLIB_VERSION} ..
......@@ -138,53 +139,54 @@ test:
- job: cert
artifacts: true
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- echo $PWD
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- if [[ "$CAOSDB_TAG" == "" ]]; then
if echo "$F_BRANCH" | grep -c "^f-" ; then
CAOSDB_TAG=${DEPLOY_REF}_F_${F_BRANCH}-latest;
docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=${DEPLOY_REF}-latest ;
else
CAOSDB_TAG=${DEPLOY_REF}-latest;
fi;
fi
- docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=dev-latest ;
- if [[ "$CAOSDB_TAG" == "" ]]; then
if echo "$F_BRANCH" | grep -c "^f-" ; then
CAOSDB_TAG=${DEPLOY_REF}_F_${F_BRANCH}-latest;
docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=${DEPLOY_REF}-latest ;
else
CAOSDB_TAG=${DEPLOY_REF}-latest;
fi;
fi
- docker pull $CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG || CAOSDB_TAG=dev-latest ;
- docker load < /image-cache/${CPPINTTEST_IMAGE_CACHE} || true
- docker pull $CPPINTTEST_REGISTRY_IMAGE
- docker load < /image-cache/${CPPINTTEST_IMAGE_CACHE} || true
- docker pull $CPPINTTEST_REGISTRY_IMAGE
- docker load < /image-cache/mariadb.tar || true
# load any(!!!) mariab image
- cd .docker
- ls -la
- ls -la cert
- docker load < /image-cache/mariadb.tar || true
# load any(!!!) mariab image
- cd .docker
- ls -la
- ls -la cert
# here the server and the mysql backend docker are being started
- echo "$CAOSDB_TAG"
- CAOSDB_TAG=$CAOSDB_TAG docker-compose up -d
# here the server and the mysql backend docker are being started
- echo "$CAOSDB_TAG"
- CAOSDB_TAG=$CAOSDB_TAG docker-compose up -d
# the pyinttest docker writes the return value of the tests into the
# file result
- /bin/sh ./run.sh
# the pyinttest docker writes the return value of the tests into the
# file result
- /bin/sh ./run.sh
# collect log files
- docker logs docker_caosdb-server_1 &> ../caosdb_log.txt
- docker logs docker_sqldb_1 &> ../mariadb_log.txt
# collect log files
- docker logs docker_caosdb-server_1 &> ../caosdb_log.txt
- docker logs docker_sqldb_1 &> ../mariadb_log.txt
# shut down
- CAOSDB_TAG=$CAOSDB_TAG docker-compose -f docker-compose.yml down
# shut down
- CAOSDB_TAG=$CAOSDB_TAG docker-compose -f docker-compose.yml down
# collect results
- rc=`cat result`
# collect results
- rc=`cat result`
# renew mariadb image in the cache (why? to renew the timestamp???)
- 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
# renew mariadb image in the cache (why? to renew the timestamp???)
- 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 with fail when errors exist
- exit $rc
# exit with fail when errors exist
- exit $rc
timeout: 3h
artifacts:
paths:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment