- Locally check if the
GoConfig.php
server configurations are correct. - If it's not correct, set the configurations and run
robo reconf deploy && robo reconf drush && robo reconf docker_deploy
and push your changes to the repo. - Add developer's public keys to the authorized keys of the "deploy" user on the server.
- Set up GITLAB repository.
- Configure traefik as a standalone reverse proxy. Example.
- Register GITLAB RUNNER for the repository.
- Install Docker on the server.
- Install Docker Compose on the server.
- Generate id_rsa and id_rsa.pub without password on the server.
- Add
public_key
to authorized_keys on the server where it was generated. - Add
<BRANCH_NAME>_SERVER_PRIVATE_KEY
to the GITLAB CI variables, as a value use theprivate_key
taken from the server. See the sectionVariables that have to be created in GIT lAB CD/CI.
below. - Prepare the folders and project files:
- Create folder on the server according to the pattern: /home/
<user_name>
/<project_machine_name>
. - Enter to the created folder.
- Clone project repo
git clone <project_address> <project_machine_name>-<branch_name> && cd <project_machine_name>-<branch_name> && rm -r .git
<project_address>
- the address of the repo.<project_machine_name>
- the configuration inGoConfig.php
<branch_name>
- git branch name (dev
,stage
,prod
)
- Take the file
deploy/docker-compose.yml
as a pattern and copy it to the project root.- According to the folder/environment, change the
traefik.frontend.rule
for apache container.
- According to the folder/environment, change the
- Run docker
make go_lin
in the project root folder.- Configure the
.env
file according to the environment. The variableGO_ENV
can be:local
,dev
,stage
orprod
.
- Configure the
- Run docker
make go_up
in the project root folder. - Get to the php container
make go_sh
.- Run
composer install
in the project root folder. - Run
robo scp
in the project root folder in order to apply correct permissions to folders and files.
- Run
- Locally run
gor pdb dev
to export your local DB to DEV environment. Or place the dump to the folder./db
, get to the container and runrobo dbi <dump-file-name>
. - Locally run
gor pf dev
to export your localfiles
folder to DEV environment. - Perform the deployment.
- Locally run
robo gdb dev
to import DEV DB to your local environment. - Locally run
robo gf dev
to import DEV filesfolder
to your local environment. - Locally run
drush @<alias> ws
to see the logs on the DEV. See all Drush commands.
- SERVER_HOST
- SERVER_USER
- DEV_SERVER_PRIVATE_KEY
- STAGE_SERVER_PRIVATE_KEY