Skip to content
Snippets Groups Projects
Commit 14c657df authored by Henrik tom Woerden's avatar Henrik tom Woerden
Browse files

Merge branch 'rewrite_ci' into 'dev'

Just trigger building and integration tests instead of single tests

See merge request bmp-caosdb/caosdb-mysqlbackend!1
parents 03785b31 3dc74074
Branches
Tags
No related merge requests found
FROM debian:stretch
RUN apt-get update && \
apt-get install curl -y
......@@ -20,137 +20,54 @@
#
# ** end header
#
stages:
- configure
- test
- setup
- clean
###########################
# configure
###########################
configure:mysql55:
stage: configure
tags: [ mysql55 ]
artifacts:
paths:
- .config.mysql55
script:
- printf "\n\n\n\n\n\n\n\n\n$MYSQL_USER_PASSWORD" > .user_input
- ./configure < .user_input
- test -f .config
- cp .config .config.mysql55
configure:mariadb10.1:
stage: configure
tags: [ maria10.1 ]
artifacts:
paths:
- .config.mariadb10.1
script:
- printf "\n\n\n\n\ncaosdb-root\n\n\n\n$MYSQL_USER_PASSWORD" > .user_input
- ./configure < .user_input
- test -f .config
- cp .config .config.mariadb10.1
variables:
CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb-mysqlbackend-testenv:latest
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using the Kubernetes executor, the variable should be set to
# tcp://localhost:2375/ because of how the Kubernetes executor connects services
# to the job container
# DOCKER_HOST: tcp://localhost:2375/
#
# For non-Kubernetes executors, we use tcp://docker:2375/
DOCKER_HOST: tcp://docker:2375/
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
##########################
# test
##########################
# test the connection
test:test-connection:mysql55:
stage: test
tags: [ mysql55 ]
dependencies:
- configure:mysql55
script:
- cp .config.mysql55 .config
- make test-connection
test:test-connection:mariadb10.1:
stage: test
tags: [ maria10.1 ]
dependencies:
- configure:mariadb10.1
script:
- cp .config.mariadb10.1 .config
- make test-connection
#########################
# setup
#########################
# install without patches and drop
setup:install:mysql55:
stage: setup
tags: [ mysql55 ]
dependencies:
- configure:mysql55
script:
- cp .config.mysql55 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- make _install
- make drop-$DATABASE_NAME
services:
- docker:dind
setup:install:mariadb10.1:
stage: setup
tags: [ maria10.1 ]
dependencies:
- configure:mariadb10.1
script:
- cp .config.mariadb10.1 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- make _install
- make drop-$DATABASE_NAME
image: $CI_REGISTRY_IMAGE
stages:
- setup
- deploy
# upgrade database with patches and drop
setup:install_upgrade:mysql55:
stage: setup
tags: [ mysql55 ]
dependencies:
- configure:mysql55
trigger_build:
stage: deploy
script:
- cp .config.mysql55 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- make install
- make drop-$DATABASE_NAME
- /usr/bin/curl -X POST
-F token=8f29e5eeb7db2123d9c2bb84634da2
-F "variables[MYSQLBACKEND]=$CI_COMMIT_REF_NAME"
-F "variables[TriggerdBy]=MYSQLBACKEND"
-F ref=master https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline
setup:install_upgrade:mariadb10.1:
build-testenv:
image: docker:latest
stage: setup
tags: [ maria10.1 ]
dependencies:
- configure:mariadb10.1
script:
- cp .config.mariadb10.1 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- make install
- make drop-$DATABASE_NAME
###############################
# cleanup
###############################
# drop database
clean:drop:mysql55:
stage: clean
when: always
tags: [ mysql55 ]
dependencies:
- configure:mysql55
script:
- cp .config.mysql55 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- if make _exists; then make drop-$DATABASE_NAME ; fi
clean:drop:mariadb10.1:
stage: clean
when: always
tags: [ maria10.1 ]
dependencies:
- configure:mariadb10.1
script:
- cp .config.mariadb10.1 .config
- export $(sed -n '/DATABASE_NAME/p ' .config)
- if make _exists; then make drop-$DATABASE_NAME ; fi
\ No newline at end of file
- cd .docker
- docker login -u testuser -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# use here general latest or specific branch latest...
- docker pull $CI_REGISTRY_IMAGE || true
- docker build
--pull
--cache-from $CI_REGISTRY_IMAGE
-t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment