M
M
MaBa20142021-05-07 13:42:44
GitLab
MaBa2014, 2021-05-07 13:42:44

How to write a CI/CD script that, after successful tests, pushes the code to the master branch from pre-relase?

Create a CI / CD (continuous integration) file in which you need to implement the following logic:

1. you upload the code to dev and nothing should happen here

2. you upload the code to the pre-realse branch

3. gitlab should do tests using CI / CD your software and if they pass, then send your code to master

The first two points do not cause problems, the last one I don’t understand at all how to release it, please tell me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-05-07
@MaBa2014

.gitlab-ci.yml

stages:
    - test
    - push

pre_release_test:
    stage: test
    only:
        - pre-realse
    script:
        - # тут описываем скриптом шаги которые нужны для тестирования

pre_release_push:
    stage: push
    only:
        - pre-realse
    script:
        - # тут описываем скриптом шаги которые нужны для того чтобы запушить код в master

It is assumed that the necessary runners in gitlab are already configured

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question