Enable e2e testing with docker-compose on GitLab (#17765)

* Make testing with docker-compose work on GitLab.

* Comment heavy jobs.

* Make testing with docker-compose work on GitLab.

* Comment heavy jobs.

* Fix images

* Addressing review.
Этот коммит содержится в:
Elisabeth Kulzer
2021-06-23 15:31:57 +02:00
коммит произвёл GitHub
родитель 58d5d51f7a
Коммит 0765f27483
15 изменённых файлов: 632 добавлений и 201 удалений

3
build/.gitignore поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,3 @@
diff.txt
latest.sql
migrated.sql

Просмотреть файл

@@ -1,10 +1 @@
CI_INBUCKET_HOST=inbucket
CI_MINIO_HOST=minio
CI_INBUCKET_PORT=10080
CI_MINIO_PORT=9000
CI_INBUCKET_SMTP_PORT=10025
CI_LDAP_HOST=openldap
IS_CI=true
MM_EMAILSETTINGS_SMTPSERVER=inbucket
MM_EMAILSETTINGS_SMTPPORT=10025
MM_ELASTICSEARCHSETTINGS_CONNECTIONURL=http://elasticsearch:9200

57
build/gitlab-dc.common.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,57 @@
version: '2.4'
services:
minio:
image: ${CI_REGISTRY}/mattermost/ci/images/minio:RELEASE.2019-10-11T00-38-09Z-1
command: "server /data"
environment:
MINIO_ACCESS_KEY: minioaccesskey
MINIO_SECRET_KEY: miniosecretkey
MINIO_SSE_MASTER_KEY: "my-minio-key:6368616e676520746869732070617373776f726420746f206120736563726574"
inbucket:
image: ${CI_REGISTRY}/mattermost/ci/images/inbucket:v3.0.0-rc1-2-gc64e7a6-1
restart: always
environment:
INBUCKET_WEB_ADDR: "0.0.0.0:10080"
INBUCKET_POP3_ADDR: "0.0.0.0:10110"
INBUCKET_SMTP_ADDR: "0.0.0.0:10025"
openldap:
image: ${CI_REGISTRY}/mattermost/ci/images/openldap:1.4.0-1
restart: always
environment:
LDAP_TLS_VERIFY_CLIENT: "never"
LDAP_ORGANISATION: "Mattermost Test"
LDAP_DOMAIN: "mm.test.com"
LDAP_ADMIN_PASSWORD: "mostest"
elasticsearch:
image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-elasticsearch-docker:6.5.1-1
environment:
http.host: "0.0.0.0"
http.port: 9200
http.cors.enabled: "true"
http.cors.allow-origin: "http://localhost:1358,http://127.0.0.1:1358"
http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
http.cors.allow-credentials: "true"
transport.host: "127.0.0.1"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
dejavu:
image: ${CI_REGISTRY}/mattermost/ci/images/dejavu:3.4.2-1
keycloak:
image: ${CI_REGISTRY}/mattermost/ci/images/keycloak:10.0.2-1
restart: always
environment:
KEYCLOAK_USER: mmuser
KEYCLOAK_PASSWORD: mostest
DB_VENDOR: h2
KEYCLOAK_IMPORT: /setup/realm.json
volumes:
- "./docker/keycloak:/setup"
prometheus:
image: ${CI_REGISTRY}/mattermost/ci/images/prometheus:2.27.1-1
volumes:
- "./docker/prometheus-linux.yml:/etc/prometheus/prometheus.yml"
grafana:
image: ${CI_REGISTRY}/mattermost/ci/images/grafana:8.0.1-1
volumes:
- "./docker/grafana/grafana.ini:/etc/grafana/grafana.ini"
- "./docker/grafana/provisioning:/etc/grafana/provisioning"
- "./docker/grafana/dashboards:/var/lib/grafana/dashboards"

102
build/gitlab-dc.mysql.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,102 @@
version: '2.4'
services:
mysql:
image: ${CI_REGISTRY}/mattermost/ci/images/mysql:5.6-1
restart: always
environment:
MYSQL_ROOT_HOST: "%"
MYSQL_ROOT_PASSWORD: mostest
MYSQL_PASSWORD: mostest
MYSQL_USER: mmuser
MYSQL_DATABASE: mattermost_test
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 10s
retries: 3
tmpfs: /var/lib/mysql
volumes:
- "./docker/mysql.conf.d:/etc/mysql/conf.d"
networks:
default:
aliases:
- mysql
minio:
extends:
file: gitlab-dc.common.yml
service: minio
networks:
default:
aliases:
- minio
inbucket:
extends:
file: gitlab-dc.common.yml
service: inbucket
networks:
default:
aliases:
- inbucket
openldap:
extends:
file: gitlab-dc.common.yml
service: openldap
networks:
default:
aliases:
- openldap
elasticsearch:
extends:
file: gitlab-dc.common.yml
service: elasticsearch
networks:
default:
aliases:
- elasticsearch
dejavu:
extends:
file: gitlab-dc.common.yml
service: dejavu
networks:
default:
aliases:
- dejavu
keycloak:
extends:
file: gitlab-dc.common.yml
service: keycloak
prometheus:
extends:
file: gitlab-dc.common.yml
service: prometheus
networks:
default:
aliases:
- prometheus
grafana:
extends:
file: gitlab-dc.common.yml
service: grafana
networks:
default:
aliases:
- grafana
start_dependencies:
image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-wait-for-dep:latest
depends_on:
- mysql
- minio
- inbucket
- openldap
- elasticsearch
- prometheus
- grafana
command: mysql:3306 minio:9000 inbucket:10080 openldap:389 elasticsearch:9200 prometheus:9090 grafana:3000
networks:
default:
networks:
default:
external:
name: ${COMPOSE_PROJECT_NAME}

101
build/gitlab-dc.postgres.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,101 @@
version: '2.4'
services:
postgres:
image: ${CI_REGISTRY}/mattermost/ci/images/postgres:10-1
restart: always
environment:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- "./docker/postgres.conf:/etc/postgresql/postgresql.conf"
healthcheck:
test: [ "CMD", "pg_isready", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 3
networks:
default:
aliases:
- postgres
minio:
extends:
file: gitlab-dc.common.yml
service: minio
networks:
default:
aliases:
- minio
inbucket:
extends:
file: gitlab-dc.common.yml
service: inbucket
networks:
default:
aliases:
- inbucket
openldap:
extends:
file: gitlab-dc.common.yml
service: openldap
networks:
default:
aliases:
- openldap
elasticsearch:
extends:
file: gitlab-dc.common.yml
service: elasticsearch
networks:
default:
aliases:
- elasticsearch
dejavu:
extends:
file: gitlab-dc.common.yml
service: dejavu
networks:
default:
aliases:
- dejavu
keycloak:
extends:
file: gitlab-dc.common.yml
service: keycloak
prometheus:
extends:
file: gitlab-dc.common.yml
service: prometheus
networks:
default:
aliases:
- prometheus
grafana:
extends:
file: gitlab-dc.common.yml
service: grafana
networks:
default:
aliases:
- grafana
start_dependencies:
image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-wait-for-dep:latest-1
depends_on:
- postgres
- minio
- inbucket
- openldap
- elasticsearch
- prometheus
- grafana
command: postgres:5432 minio:9000 inbucket:10080 openldap:389 elasticsearch:9200 prometheus:9090 grafana:3000
networks:
default:
networks:
default:
external:
name: ${COMPOSE_PROJECT_NAME}

36
build/gitlab-dc.schemamysql.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,36 @@
version: '2.4'
services:
mysql:
image: ${CI_REGISTRY}/mattermost/ci/images/mysql:5.6-1
restart: always
environment:
MYSQL_ROOT_HOST: "%"
MYSQL_ROOT_PASSWORD: mostest
MYSQL_PASSWORD: mostest
MYSQL_USER: mmuser
MYSQL_DATABASE: mattermost_test
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 10s
retries: 3
tmpfs: /var/lib/mysql
volumes:
- "./docker/mysql.conf.d:/etc/mysql/conf.d"
networks:
default:
aliases:
- mysql
start_dependencies:
image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-wait-for-dep:latest-1
depends_on:
- mysql
command: mysql:3306
networks:
default:
networks:
default:
external:
name: ${COMPOSE_PROJECT_NAME}

34
build/gitlab-dc.schemapostgres.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,34 @@
version: '2.4'
services:
postgres:
image: ${CI_REGISTRY}/mattermost/ci/images/postgres:10-1
restart: always
environment:
POSTGRES_USER: mmuser
POSTGRES_PASSWORD: mostest
POSTGRES_DB: mattermost_test
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- "./docker/postgres.conf:/etc/postgresql/postgresql.conf"
healthcheck:
test: [ "CMD", "pg_isready", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 3
networks:
default:
aliases:
- postgres
start_dependencies:
image: ${CI_REGISTRY}/mattermost/ci/images/mattermost-wait-for-dep:latest-1
depends_on:
- postgres
command: postgres:5432
networks:
default:
networks:
default:
external:
name: ${COMPOSE_PROJECT_NAME}