Add .gitlab-ci.yml-compatible continuous integration configuration (#17844)

* Add .gitlab-ci.collabora.yml continuous integration configuration

* Relocate custom GitLab CI/CD configuration file to 'contrib' directory

* Fixup: .gitlab-ci.collabora.yml -> .gitlab-ci.yml

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
James Addison
2021-10-29 12:16:45 +01:00
коммит произвёл GitHub
родитель 5f4199db4f
Коммит 8c4e6a85b3
2 изменённых файлов: 68 добавлений и 0 удалений

61
build/contrib/gitlab/.gitlab-ci.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,61 @@
lint:
allow_failure: true
image: golangci/golangci-lint
script:
- GO111MODULE=off GOBIN=$PWD/bin go get -u github.com/mattermost/mattermost-govet
- make config-reset
- make check-style
test-quick:
image: docker
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
TEST_DATABASE_MYSQL_DSN: "mmuser:mostest@tcp(mysql:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s&multiStatements=true"
TEST_DATABASE_POSTGRESQL_DSN: "postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10"
TEST_DATABASE_MYSQL_ROOT_PASSWD: "mostest"
services:
- docker:dind
before_script:
- apk add --no-cache bash docker-compose go make
- make start-docker
script:
- docker run
--env MM_NO_DOCKER=true
--env-file "build/dotenv/test.env"
--mount "type=bind,source=$PWD,target=$PWD"
--network "$CI_PROJECT_NAME"_mm-test
docker
/bin/sh -c "
cd $PWD;
apk add --no-cache bash docker-compose go mailcap make;
make test-server-quick;
"
test-full:
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
image: docker
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
TEST_DATABASE_MYSQL_DSN: "mmuser:mostest@tcp(mysql:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s&multiStatements=true"
TEST_DATABASE_POSTGRESQL_DSN: "postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10"
TEST_DATABASE_MYSQL_ROOT_PASSWD: "mostest"
services:
- docker:dind
before_script:
- apk add --no-cache bash docker-compose go make
- make start-docker
script:
- docker run
--env MM_NO_DOCKER=true
--env-file "build/dotenv/test.env"
--mount "type=bind,source=$PWD,target=$PWD"
--network "$CI_PROJECT_NAME"_mm-test
docker
/bin/sh -c "
cd $PWD;
apk add --no-cache bash docker-compose go mailcap make;
make test-server;
"

7
build/contrib/gitlab/README.md Обычный файл
Просмотреть файл

@@ -0,0 +1,7 @@
# GitLab CI/CD configuration for Mattermost
The [.gitlab-ci.yml](./.gitlab-ci.yml) file in this directory provides a [GitLab CI/CD configuration file](https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html) that can be used to run linting and unit testing for the Mattermost application.
## Usage
To configure your GitLab instance to use this configuration file (and without having to move it to the base directory in this git repository), you can configure the [`CI_CONFIG_PATH` predefined variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) for the repository in GitLab with the configuration file path (`build/contrib/gitlab/.gitlab-ci.yml`).