P
P
pipline2019-12-19 23:39:02
Python
pipline, 2019-12-19 23:39:02

Gitlab CI/CD php applications in docker. How to organize?

I want to organize the assembly, testing and delivery of the application.
What is:
- docker-compose.yml with 3 services (nginx, php-fpm, mysql)
- .gitlab-ci.yml with 2 (so far) stages and 3 jobs (build + test (unit tests) .cs validation))
Questions:
1. How to properly fumble containers (which were collected in the first step) between jobs? Push at the build stage to the registry, then at each step do pull or docker save and into artifacts?
2. How to properly assemble and deliver the application for production? Where to make a build?
ps if there are materials on my questions, it will be great if you let me read it :)

Answer the question

In order to leave comments, you need to log in

5 answer(s)
B
BJlaDuMup, 2019-02-10
@zlodiak

def pr(self):
    try:
      print(self.last_name)
    except AttributeError:
      print('var has been deleted')

M
Max Payne, 2019-02-11
@YardalGedal

def pr(self):
    if hasatrr(self, 'last_name'):
        print(self.last_name)
    else:
        print('var has been deleted')

Or maybe in one line
def pr(self):
    print(getattr(self, 'last_name', 'var has been deleted'))

A
Andy_U, 2019-02-11
@Andy_U

Isn't that better?

def pr(self) -> bool:
    return 'last_name' in self.__dir__()

O
OnYourLips, 2019-12-20
@pipline

2. The build has already been made during the build in the first step. And was poured into test environments after successful testing and tested by meat people.
You don't need to build anything during deployment.
The CD in the gitlab is weak, I would recommend this approach: the deployment script (and manifests) in a separate project, it will be responsible for placing previously built images on the necessary machines (test or production).
The machine, project and other parameters can be specified before starting.
Convenient to do with https://docs.gitlab.com/ce/ci/chatops/

�
âš¡ Kotobotov âš¡, 2019-12-20
@angrySCV

it is better to fumble containers through the repository, because due to the caching of layers, a very fast and efficient scheme of work is obtained.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question