GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

Ko tenei tuhinga ka aro nui ki nga kaiwhakaatu me nga kaiwhakawhanake, engari ko te nuinga mo nga tohunga miihini e pa ana ki te raru o te whakatuu GitLab CI/CD mo te whakamatautau whakauru i roto i nga tikanga o te kore rawa o nga rauemi hanganga me te kore o te ipu. tūāpapa orkestra. Ka korerotia e ahau ki a koe me pehea te whakarite i te whakatakotoranga o nga taiao whakamatautau ma te whakamahi i te tito docker ki runga i te kaikawe anga GitLab kotahi, a na te tuku i nga taiao maha, kaore nga ratonga i whakarewahia e pokanoa tetahi ki tetahi.


Tuhinga

Nga whakaritenga

  1. I roto i taku mahi, he maha nga wa i "whakamatautauhia" te whakamatautau whakauru i runga i nga kaupapa. A ko te raru tuatahi me te tino nui ko te paipa CI, kei reira nga whakamatautau whakauru e whakawhanakehia ana Ka mahia nga ratonga i roto i te taiao dev/atamira. He maha nga raruraru i puta mai i tenei:

    • Na nga hapa o tetahi ratonga i te wa o te whakamatautau whakauru, ka pakaru pea te waahi whakamatautau i nga raraunga pakaru. I etahi wa ka tukuna he tono me te whakatakotoranga JSON pakaru i pakaru te ratonga, na reira ka kore e taea te mahi.
    • Te whakaroa o te ara iahiko whakamatautau i te pikinga o nga raraunga whakamatautau. Ki taku whakaaro karekau he tikanga ki te whakaahua i tetahi tauira me te horoi/whakahoki whakamuri i te putunga raraunga. I roto i aku mahi, kare ano au i tutaki ki tetahi kaupapa i haere pai ai tenei tikanga.
    • Ko te morearea o te whakararu i te mahi o te ara iahiko whakamatautau i te wa e whakamatautau ana i nga tautuhinga punaha whanui. Hei tauira, he kaupapa here kaiwhakamahi/rōpū/kupuhipa/tono.
    • Ko nga raraunga whakamatautau mai i nga whakamatautau aunoa ka uaua te oranga mo nga kaitoro a-ringa.

    Ko etahi ka kii ko nga whakamatautau aunoa pai me horoi nga raraunga i muri i a raatau ano. He tohe taku ki:

    • He tino watea ki te whakamahi i nga turanga hihiko.
    • Kaore e taea te tango i nga mea katoa mai i te punaha ma te API. Hei tauira, ko te waea ki te muku i tetahi mea kaore i whakatinanahia na te mea ka whakahē i te arorau pakihi.
    • A, no te hanga i tetahi mea ma te API, ka taea te hanga i te nui o nga metadata, he raruraru ki te whakakore.
    • Mena ka whakawhirinaki nga whakamatautau ki a raatau ano, katahi ka huri te tukanga o te horoi i nga raraunga i muri i nga whakamatautau ka huri ki te mahunga.
    • Ko etahi atu (me taku whakaaro, kaore i te tika) nga waea ki te API.
    • A ko te tohenga matua: ka tiimata ana nga raraunga whakamatautau ki te whakawātea tika mai i te pātengi raraunga. Ka huri tenei ki te PK/FK circus tūturu! Ka rongo matou mai i nga kaiwhakawhanake: "Katahi ano ahau ka tapiri/tangohia/whakaingoatia he tohu, he aha i mau ai nga whakamatautau whakauru 100500?"

    Ki taku whakaaro, ko te otinga tino pai ko te taiao hihiri.

  2. He maha nga tangata e whakamahi ana i te docker-compose ki te whakahaere i tetahi taiao whakamatautau, engari he iti noa nga tangata e whakamahi ana i te docker-compose i te wa e whakahaere ana i nga whakamatautau whakauru ki te CI/CD. I konei kaore au i te whai whakaaro ki nga kubernetes, pokai me etahi atu papahanga whakahiato ipu. Kaore nga kamupene katoa i a raatau. He pai mena ko docker-compose.yml te ao.
  3. Ahakoa kei a tatou ake ano te kaikawe QA, me pehea e taea ai e tatou te whakarite kia kore nga ratonga i whakarewahia ma te docker-compose e pokanoa tetahi ki tetahi?
  4. Me pehea te kohikohi i nga raarangi o nga ratonga kua whakamatauria?
  5. Me pehea te horoi i te kaihoroi?

Kei a au ake taku kaikawe GitLab mo aku kaupapa, ka tutaki ahau ki enei patai i te wa e whanake ana Kiritaki Java ki TestRail. He tika ake, i te wa e whakahaere ana i nga whakamatautau whakauru. Kei raro nei ka whakatauhia enei take ma te whakamahi i nga tauira mai i tenei kaupapa.

Ki nga ihirangi

GitLab Shell Runner

Mo te kaiwhaiwhai, ka tūtohu ahau he miihini mariko Linux me te 4 vCPU, 4 GB RAM, 50 GB HDD.
He maha nga korero mo te whakatuu gitlab-runner i runga i te Ipurangi, no reira poto:

  • Takiuru ki te miihini ma te SSH
  • Mena he iti ake i te 8 GB RAM, ka tūtohu ahau whakawhiti 10 GBkia kore ai te kaipatu OOM e haere mai ki te patu i a tatou mahi na te kore o te RAM. Ka puta tenei ina neke atu i te 5 nga mahi ka whakarewahia i te wa kotahi. Ka tere haere nga mahi, engari ka mau tonu.

    He tauira me te kaipatu OOM

    Mena ka kite koe i nga raarangi mahi bash: line 82: 26474 Killed, katahi ka mahia ki runga i te kaiwhaiwhai sudo dmesg | grep 26474

    [26474]  1002 26474  1061935   123806     339        0             0 java
    Out of memory: Kill process 26474 (java) score 127 or sacrifice child
    Killed process 26474 (java) total-vm:4247740kB, anon-rss:495224kB, file-rss:0kB, shmem-rss:0kB

    A, ki te penei te ahua o te pikitia, katahi ka taapirihia te whakawhiti me te taapiri RAM.

  • Whakauruhia gitlab-runner, toka, te mahi a-toka, hanga.
  • Te taapiri i tetahi kaiwhakamahi gitlab-runner ki te roopu docker
    sudo groupadd docker
    sudo usermod -aG docker gitlab-runner
  • Rehita gitlab-runner.
  • Tuwhera mo te whakatika /etc/gitlab-runner/config.toml me te tapiri

    concurrent=20
    [[runners]]
      request_concurrency = 10

    Ma tenei ka taea e koe te whakahaere i nga mahi whakarara i runga i te kaiwhai kotahi. Pānuitia atu konei.
    Mena kei a koe he miihini kaha ake, hei tauira 8 vCPU, 16 GB RAM, ka taea te hanga i enei nama kia 2 nga wa nui ake. Engari ka whakawhirinaki katoa ki nga mea ka tukuna ki runga i tenei kaiwhai me te aha te rahinga.

He nui tena.

Ki nga ihirangi

Te whakarite docker-compose.yml

Ko te mahi matua he docker-compose.yml, ka taea e nga kaiwhakawhanake/kaiwhakamatau te whakamahi i te rohe me te paipa CI.

Tuatahi, ka hangaia e matou nga ingoa ratonga ahurei mo CI. Ko tetahi o nga taurangi ahurei i roto i te GitLab CI ko te taurangi CI_JOB_ID. Mena ka tohua e koe container_name me te tikanga "service-${CI_JOB_ID:-local}", na i roto i te keehi:

  • ki te CI_JOB_ID kaore i tautuhia i nga taurangi taiao,
    katahi ko te ingoa ratonga service-local
  • ki te CI_JOB_ID kua tautuhia i roto i nga taurangi taiao (hei tauira 123),
    katahi ko te ingoa ratonga service-123

Tuarua, ka hangaia e matou he whatunga noa mo nga ratonga kua whakarewahia. Ma tenei ka wehe mai i te taumata-whatunga i te wa e whakahaere ana i nga taiao whakamatautau maha.

networks:
  default:
    external:
      name: service-network-${CI_JOB_ID:-local}

Inaa, koinei te taahiraa tuatahi ki te angitu =)

He tauira o taku docker-compose.yml me nga korero

version: "3"

# Для корректной работы web (php) и fmt нужно, 
# чтобы контейнеры имели общий исполняемый контент.
# В нашем случае, это директория /var/www/testrail
volumes:
  static-content:

# Изолируем окружение на сетевом уровне
networks:
  default:
    external:
      name: testrail-network-${CI_JOB_ID:-local}

services:
  db:
    image: mysql:5.7.22
    # Каждый container_name содержит ${CI_JOB_ID:-local}
    container_name: "testrail-mysql-${CI_JOB_ID:-local}"
    environment:
      MYSQL_HOST: db
      MYSQL_DATABASE: mydb
      MYSQL_ROOT_PASSWORD: 1234
      SKIP_GRANT_TABLES: 1
      SKIP_NETWORKING: 1
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
    - default

  migration:
    image: registry.gitlab.com/touchbit/image/testrail/migration:latest
    container_name: "testrail-migration-${CI_JOB_ID:-local}"
    links:
    - db
    depends_on:
    - db
    networks:
    - default

  fpm:
    image: registry.gitlab.com/touchbit/image/testrail/fpm:latest
    container_name: "testrail-fpm-${CI_JOB_ID:-local}"
    volumes:
    - static-content:/var/www/testrail
    links:
    - db
    networks:
    - default

  web:
    image: registry.gitlab.com/touchbit/image/testrail/web:latest
    container_name: "testrail-web-${CI_JOB_ID:-local}"
    # Если переменные TR_HTTP_PORT или TR_HTTPS_PORTS не определены,
    # то сервис поднимается на 80 и 443 порту соответственно.
    ports:
      - ${TR_HTTP_PORT:-80}:80
      - ${TR_HTTPS_PORT:-443}:443
    volumes:
      - static-content:/var/www/testrail
    links:
      - db
      - fpm
    networks:
      - default

He tauira oma rohe

docker-compose -f docker-compose.yml up -d
Starting   testrail-mysql-local     ... done
Starting   testrail-migration-local ... done
Starting   testrail-fpm-local       ... done
Recreating testrail-web-local       ... done

Engari ehara i te mea ngawari katoa me te whakarewatanga i roto i te CI.

Ki nga ihirangi

Te whakarite i te Makefile

Ka whakamahi ahau i te Makefile na te mea he tino watea mo te whakahaere taiao o te rohe me te CI. Ētahi atu kōrero ipurangi

# У меня в проектах все вспомогательные вещи лежат в директории `.indirect`,
# в том числе и `docker-compose.yml`

# Использовать bash с опцией pipefail 
# pipefail - фейлит выполнение пайпа, если команда выполнилась с ошибкой
SHELL=/bin/bash -o pipefail

# Останавливаем контейнеры и удаляем сеть
docker-kill:
    docker-compose -f $${CI_JOB_ID:-.indirect}/docker-compose.yml kill
    docker network rm network-$${CI_JOB_ID:-testrail} || true

# Предварительно выполняем docker-kill 
docker-up: docker-kill
    # Создаем сеть для окружения 
    docker network create network-$${CI_JOB_ID:-testrail}
    # Забираем последние образы из docker-registry
    docker-compose -f $${CI_JOB_ID:-.indirect}/docker-compose.yml pull
    # Запускаем окружение
    # force-recreate - принудительное пересоздание контейнеров
    # renew-anon-volumes - не использовать volumes предыдущих контейнеров
    docker-compose -f $${CI_JOB_ID:-.indirect}/docker-compose.yml up --force-recreate --renew-anon-volumes -d
    # Ну и, на всякий случай, вывести что там у нас в принципе запущено на машинке
    docker ps

# Коллектим логи сервисов
docker-logs:
    mkdir ./logs || true
    docker logs testrail-web-$${CI_JOB_ID:-local}       >& logs/testrail-web.log
    docker logs testrail-fpm-$${CI_JOB_ID:-local}       >& logs/testrail-fpm.log
    docker logs testrail-migration-$${CI_JOB_ID:-local} >& logs/testrail-migration.log
    docker logs testrail-mysql-$${CI_JOB_ID:-local}     >& logs/testrail-mysql.log

# Очистка раннера
docker-clean:
    @echo Останавливаем все testrail-контейнеры
    docker kill $$(docker ps --filter=name=testrail -q) || true
    @echo Очистка докер контейнеров
    docker rm -f $$(docker ps -a -f --filter=name=testrail status=exited -q) || true
    @echo Очистка dangling образов
    docker rmi -f $$(docker images -f "dangling=true" -q) || true
    @echo Очистка testrail образов
    docker rmi -f $$(docker images --filter=reference='registry.gitlab.com/touchbit/image/testrail/*' -q) || true
    @echo Очистка всех неиспользуемых volume
    docker volume rm -f $$(docker volume ls -q) || true
    @echo Очистка всех testrail сетей
    docker network rm $(docker network ls --filter=name=testrail -q) || true
    docker ps

Arowhai

hanga docker-up

$ make docker-up 
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml kill
Killing testrail-web-local   ... done
Killing testrail-fpm-local   ... done
Killing testrail-mysql-local ... done
docker network rm network-${CI_JOB_ID:-testrail} || true
network-testrail
docker network create network-${CI_JOB_ID:-testrail}
d2ec063324081c8bbc1b08fd92242c2ea59d70cf4025fab8efcbc5c6360f083f
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml pull
Pulling db        ... done
Pulling migration ... done
Pulling fpm       ... done
Pulling web       ... done
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml up --force-recreate --renew-anon-volumes -d
Recreating testrail-mysql-local ... done
Recreating testrail-fpm-local       ... done
Recreating testrail-migration-local ... done
Recreating testrail-web-local       ... done
docker ps
CONTAINER ID  PORTS                                     NAMES
a845d3cb0e5a  0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp  testrail-web-local
19d8ef001398  9000/tcp                                  testrail-fpm-local
e28840a2369c  3306/tcp, 33060/tcp                       testrail-migration-local
0e7900c23f37  3306/tcp                                  testrail-mysql-local

hanga docker-logs

$ make docker-logs
mkdir ./logs || true
mkdir: cannot create directory ‘./logs’: File exists
docker logs testrail-web-${CI_JOB_ID:-local}       >& logs/testrail-web.log
docker logs testrail-fpm-${CI_JOB_ID:-local}       >& logs/testrail-fpm.log
docker logs testrail-migration-${CI_JOB_ID:-local} >& logs/testrail-migration.log
docker logs testrail-mysql-${CI_JOB_ID:-local}     >& logs/testrail-mysql.log

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

Ki nga ihirangi

Te whakarite .gitlab-ci.yml

Te whakahaere i nga whakamatautau whakauru

Integration:
  stage: test
  tags:
    - my-shell-runner
  before_script:
    # Аутентифицируемся в registry
    - docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
    # Генерируем псевдоуникальные TR_HTTP_PORT и TR_HTTPS_PORT
    - export TR_HTTP_PORT=$(shuf -i10000-60000 -n1)
    - export TR_HTTPS_PORT=$(shuf -i10000-60000 -n1)
    # создаем директорию с идентификатором задачи
    - mkdir ${CI_JOB_ID}
    # копируем в созданную директорию наш docker-compose.yml
    # чтобы контекст был разный для каждой задачи
    - cp .indirect/docker-compose.yml ${CI_JOB_ID}/docker-compose.yml
  script:
    # поднимаем наше окружение
    - make docker-up
    # запускаем тесты исполняемым jar (у меня так)
    - java -jar itest.jar --http-port ${TR_HTTP_PORT} --https-port ${TR_HTTPS_PORT}
    # или в контейнере
    - docker run --network=testrail-network-${CI_JOB_ID:-local} --rm itest
  after_script:
    # собираем логи
    - make docker-logs
    # останавливаем окружение
    - make docker-kill
  artifacts:
    # сохраняем логи
    when: always
    paths:
      - logs
    expire_in: 30 days

Ko te hua o te whakahaere i taua mahi, kei roto i te raarangi raarangi i roto i nga taonga toi nga raarangi ratonga me nga raarangi whakamatautau. He tino watea ina he he. Ko ia whakamatautau ka tuhi i tana ake raarangi, engari ka korero motuhake ahau mo tenei.

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

Ki nga ihirangi

Te horoi i te kaihoroi

Ka whakarewahia te mahi i runga i te waarangi anake.

stages:
- clean
- build
- test

Clean runner:
  stage: clean
  only:
    - schedules
  tags:
    - my-shell-runner
  script:
    - make docker-clean

I muri mai, haere ki ta maatau kaupapa GitLab -> CI / CD -> Whakaritea -> Whakaritea Hou me te taapiri i te waarangi hou

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

Ki nga ihirangi

hua

Te whakarewa i nga mahi e 4 ki GitLab CI
GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

I roto i nga rarangi o te mahi whakamutunga me nga whakamatautau whakauru ka kite tatou i nga ipu mai i nga mahi rereke

CONTAINER ID  NAMES
c6b76f9135ed  testrail-web-204645172
01d303262d8e  testrail-fpm-204645172
2cdab1edbf6a  testrail-migration-204645172
826aaf7c0a29  testrail-mysql-204645172
6dbb3fae0322  testrail-web-204645084
3540f8d448ce  testrail-fpm-204645084
70fea72aa10d  testrail-mysql-204645084
d8aa24b2892d  testrail-web-204644881
6d4ccd910fad  testrail-fpm-204644881
685d8023a3ec  testrail-mysql-204644881
1cdfc692003a  testrail-web-204644793
6f26dfb2683e  testrail-fpm-204644793
029e16b26201  testrail-mysql-204644793
c10443222ac6  testrail-web-204567103
04339229397e  testrail-fpm-204567103
6ae0accab28d  testrail-mysql-204567103
b66b60d79e43  testrail-web-204553690
033b1f46afa9  testrail-fpm-204553690
a8879c5ef941  testrail-mysql-204553690
069954ba6010  testrail-web-204553539
ed6b17d911a5  testrail-fpm-204553539
1a1eed057ea0  testrail-mysql-204553539

Rakau taipitopito atu

$ docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/gitlab-runner/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
$ export TR_HTTP_PORT=$(shuf -i10000-60000 -n1)
$ export TR_HTTPS_PORT=$(shuf -i10000-60000 -n1)
$ mkdir ${CI_JOB_ID}
$ cp .indirect/docker-compose.yml ${CI_JOB_ID}/docker-compose.yml
$ make docker-up
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml kill
docker network rm testrail-network-${CI_JOB_ID:-local} || true
Error: No such network: testrail-network-204645172
docker network create testrail-network-${CI_JOB_ID:-local}
0a59552b4464b8ab484de6ae5054f3d5752902910bacb0a7b5eca698766d0331
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml pull
Pulling web       ... done
Pulling fpm       ... done
Pulling migration ... done
Pulling db        ... done
docker-compose -f ${CI_JOB_ID:-.indirect}/docker-compose.yml up --force-recreate --renew-anon-volumes -d
Creating volume "204645172_static-content" with default driver
Creating testrail-mysql-204645172 ... 
Creating testrail-mysql-204645172 ... done
Creating testrail-migration-204645172 ... done
Creating testrail-fpm-204645172       ... done
Creating testrail-web-204645172       ... done
docker ps
CONTAINER ID        IMAGE                                                          COMMAND                  CREATED              STATUS              PORTS                                           NAMES
c6b76f9135ed        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   13 seconds ago       Up 1 second         0.0.0.0:51148->80/tcp, 0.0.0.0:25426->443/tcp   testrail-web-204645172
01d303262d8e        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   16 seconds ago       Up 13 seconds       9000/tcp                                        testrail-fpm-204645172
2cdab1edbf6a        registry.gitlab.com/touchbit/image/testrail/migration:latest   "docker-entrypoint.s…"   16 seconds ago       Up 13 seconds       3306/tcp, 33060/tcp                             testrail-migration-204645172
826aaf7c0a29        mysql:5.7.22                                                   "docker-entrypoint.s…"   18 seconds ago       Up 16 seconds       3306/tcp                                        testrail-mysql-204645172
6dbb3fae0322        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   36 seconds ago       Up 22 seconds       0.0.0.0:44202->80/tcp, 0.0.0.0:20151->443/tcp   testrail-web-204645084
3540f8d448ce        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   38 seconds ago       Up 35 seconds       9000/tcp                                        testrail-fpm-204645084
70fea72aa10d        mysql:5.7.22                                                   "docker-entrypoint.s…"   40 seconds ago       Up 37 seconds       3306/tcp                                        testrail-mysql-204645084
d8aa24b2892d        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   About a minute ago   Up 53 seconds       0.0.0.0:31103->80/tcp, 0.0.0.0:43872->443/tcp   testrail-web-204644881
6d4ccd910fad        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   About a minute ago   Up About a minute   9000/tcp                                        testrail-fpm-204644881
685d8023a3ec        mysql:5.7.22                                                   "docker-entrypoint.s…"   About a minute ago   Up About a minute   3306/tcp                                        testrail-mysql-204644881
1cdfc692003a        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   About a minute ago   Up About a minute   0.0.0.0:44752->80/tcp, 0.0.0.0:23540->443/tcp   testrail-web-204644793
6f26dfb2683e        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   About a minute ago   Up About a minute   9000/tcp                                        testrail-fpm-204644793
029e16b26201        mysql:5.7.22                                                   "docker-entrypoint.s…"   About a minute ago   Up About a minute   3306/tcp                                        testrail-mysql-204644793
c10443222ac6        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   5 hours ago          Up 5 hours          0.0.0.0:57123->80/tcp, 0.0.0.0:31657->443/tcp   testrail-web-204567103
04339229397e        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   5 hours ago          Up 5 hours          9000/tcp                                        testrail-fpm-204567103
6ae0accab28d        mysql:5.7.22                                                   "docker-entrypoint.s…"   5 hours ago          Up 5 hours          3306/tcp                                        testrail-mysql-204567103
b66b60d79e43        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   5 hours ago          Up 5 hours          0.0.0.0:56321->80/tcp, 0.0.0.0:58749->443/tcp   testrail-web-204553690
033b1f46afa9        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   5 hours ago          Up 5 hours          9000/tcp                                        testrail-fpm-204553690
a8879c5ef941        mysql:5.7.22                                                   "docker-entrypoint.s…"   5 hours ago          Up 5 hours          3306/tcp                                        testrail-mysql-204553690
069954ba6010        registry.gitlab.com/touchbit/image/testrail/web:latest         "nginx -g 'daemon of…"   5 hours ago          Up 5 hours          0.0.0.0:32869->80/tcp, 0.0.0.0:16066->443/tcp   testrail-web-204553539
ed6b17d911a5        registry.gitlab.com/touchbit/image/testrail/fpm:latest         "docker-php-entrypoi…"   5 hours ago          Up 5 hours          9000/tcp                                        testrail-fpm-204553539
1a1eed057ea0        mysql:5.7.22                                                   "docker-entrypoint.s…"   5 hours ago          Up 5 hours          3306/tcp                                        testrail-mysql-204553539

I tutuki pai nga mahi katoa

Kei roto i nga mahi toi he raarangi ratonga me nga raarangi whakamatautau
GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

He ahua ataahua nga mea katoa, engari he ahua ano. Ka taea te whakakore i te paipa i te wa e whakahaere ana nga whakamatautau whakaurunga, penei ka kore e mutu nga ipu rere. Mai i etahi wa me horoi e koe te kaihoroi. Engari, ko te mahi hei whakapai ake i te GitLab CE kei te noho tonu tuwhera

Engari kua taapirihia e matou te whakarewatanga o tetahi mahi i runga i te waarangi, kaore he tangata e aukati i a maatau ki te whakahaere a-ringa.
Haere ki to maatau kaupapa -> CI / CD -> Whakaritea me te whakahaere i te mahi Clean runner

GitLab Shell Runner. Te whakarewanga whakataetae o nga ratonga kua whakamatauria ma te whakamahi i te Docker Compose

Te tapeke:

  • Kotahi ta matou kaikawe anga.
  • Karekau he taupatupatu i waenga i nga mahi me te taiao.
  • Ka whakahaerehia e matou nga mahi me nga whakamatautau whakauru i roto i te whakarara.
  • Ka taea e koe te whakahaere i nga whakamatautau whakauru i te rohe, i roto ranei i te ipu.
  • Ko nga raarangi ratonga me nga raarangi whakamatautau ka kohia ka piri ki te mahi paipa.
  • Ka taea te horoi i te kaikawe mai i nga whakaahua Docker tawhito.

Ko te wa tatūnga he ~2 haora.
Ko te katoa, mau. Ka koa ahau ki te whiwhi urupare.

Ki nga ihirangi

Source: will.com

Tāpiri i te kōrero