Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 4.33 KiB
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
# Copyright (C) 2019 Henrik tom Wörden
# Copyright (C) 2020 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

variables:
   CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/caosdb-advanced-user-tools/testenv:latest
   CI_REGISTRY_IMAGE_BASE: $CI_REGISTRY/caosdb/caosdb-advanced-user-tools/base:latest
   # When using dind, it's wise to use the overlayfs driver for
   # improved performance.

services:
  - docker:19.03.0-dind

stages: 
  - setup
  - cert
  - style
  - unittest
  - integrationtest
  - deploy

test:
  tags: [cached-dind]
  stage: integrationtest
  image: $CI_REGISTRY_IMAGE_BASE
  script:
      - if [[ "$CAOSDB_TAG" == "" ]]; then
            CAOSDB_TAG=dev-latest;
        fi
      - echo $CAOSDB_TAG
      - time docker load < /image-cache/caosdb-advanced-testenv.tar || true
      - time docker load < /image-cache/mariadb.tar || true
      - time docker load < /image-cache/caosdb.tar || true
      - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
      - docker login -u gitlab+deploy-token-ci-pull -p $TOKEN_CI_PULL $CI_REGISTRY_INDISCALE
      - time docker pull $CI_REGISTRY_IMAGE
      - time docker pull mariadb:10.4
      - time docker pull $CI_REGISTRY_INDISCALE/caosdb/src/caosdb-deploy:$CAOSDB_TAG
      - EXEPATH=`pwd` CAOSDB_TAG=$CAOSDB_TAG docker-compose 
        -f .docker/docker-compose.yml up -d
      - cd .docker 
      - /bin/sh ./run.sh
      - cd .. 
      - docker logs docker_caosdb-server_1 &> ../caosdb_log.txt
      - docker logs docker_sqldb_1 &> ../mariadb_log.txt
      - docker-compose -f .docker/docker-compose.yml down
      - rc=`cat .docker/result`  
      - exit $rc
  dependencies: [cert]
  artifacts:
    paths:
      - caosdb_log.txt