Skip to content

Commit

Permalink
CI/CD (Gitlab & GitHub)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-yakovlev committed Apr 25, 2023
1 parent 593ea70 commit ae07463
Show file tree
Hide file tree
Showing 38 changed files with 1,580 additions and 913 deletions.
56 changes: 15 additions & 41 deletions .env
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=4dc864551c629050891450322dccc748
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7&charset=utf8mb4"
DATABASE_URL="postgresql://symfony:symfony@postgres:5432/symfony?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=195b446ef026e4ea6969f5f86d7b9b96
###< lexik/jwt-authentication-bundle ###
#APP_ENV=prod
#APP_SECRET=4dc864551c62905089314503222dccc748

DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=

#JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
#JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_SECRET_KEY=# Required base64 encoded Private Key
JWT_PUBLIC_KEY=# Required base64 encoded Public Key
JWT_TOKEN_TTL=3600
JWT_PASSPHRASE=# Required
14 changes: 14 additions & 0 deletions .env.local.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
APP_ENV=dev
APP_SECRET=4dc864551c62905089314503222dccc748
APP_DEBUG=1

DB_HOST=postgres
DB_NAME=symfony
DB_USER=symfony
DB_PASSWORD=symfony
DB_PORT=5432

JWT_SECRET_KEY=LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpQcm9jLVR5cGU6IDQsRU5DUllQVEVECkRFSy1JbmZvOiBBRVMtMjU2LUNCQywzRTVERjkyMzczNjVDMzY1MDUwMzAyNzg0ODA5Mjg3QwoKVzFaOTBWV2xXdzQrZjNoRUhwYUo3blRMSElWRmtUU29NMHNFdW81UzB5NlNMTHV5YjljeFJwSlQxMkRETW9hSQoyMUFDMUFTSGdhOUpCK0VreDFDRlp2VkZVUHRtZGluYTVZR1E3RnYxTUR2TE5aeVFReVZzMFBuZm00VGkxa0ZMCmZUczcrU1U1R0F6YVozdVlrblFtZlNyNWcxUGNLSUtKSkpsUkxIWXZwbFE0UCt4Y3BjNTNhNlg5bU9GcE1wbHIKNk1Fc2pDeklQZndhL2I2K3NweHlsQXRSR0hXRGNFOUNDRUtESkxNSkJ6ZXpmeGdMZHpqT000ZjRFZXN3NGpGUQphZVFhNGVTTFE3NmhiY1RBNUt4d21kRHI5N2V4TkcyMTNzdzdFa0FqMkg4ZEFyYTNIN0ZzZ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Xbk1QWExFYVFoZ05CQWFBTVpHNEZFOTZuaUdWOXZZd2JTMllwUGw3RApYcnJlNkJCK0VQd0lCWHFPWGpjWWJ5S3B3NkJnS2ZVbE85RUFWcW9HRWJCQVRjWmp2RmpVSTdQRU9EbEZLL1d3CkZUM09PbFhYUWwzVXV5S3ZCUEI4Q3k4RlNoYTErV093b3AxK1paZWQ4U0tzaytiRWRjOWo3RW5oR3BiUUx1Tm8KZmFzMnl5aDAxayt1cWF5QmJlMDJ1dmZOZ1lzZld1SEt1WWZieEhGK0JIYW1EQWpUOHpaTDBSeEsweVdvbmhZbwozZndEYlNqRDdsNUcxQVNqUUNtUjBPWWhtVThnS21jOWhrZGUzeUZkdExnVHhzd2VuVm5JODljQWxDZzAxUjh0CmpBTUFYQldaVU50U09NQ3ZjOFdrcHNSb0crc0xVd3JYZVZzbnR2WTB0V3ZObklzYVZWeWh1RHp4YS9WUmxRQTMKWGtKTWtMOWh5enFiZWMyWS9TVklYT2V5U0xIbDVrTWhpclE0c2tFNHdESFo1TWMwTElLZ3NNVVRaNmtEZ1MzRApydjd5em5tc2dNKzlHbGFFUnJWT1lLU3ppaWZ2c3MvLzU2bGxNb0lVOGhvSUtaek1hNEZtcGY5Z0liVzVqYVdHClgza3ZwZHhPV2EvVEpYMm5yQ1kyNTNzQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=
JWT_TOKEN_TTL=3600
JWT_PASSPHRASE=passphrase
13 changes: 12 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# define your env variables for the test env here
APP_ENV=test
KERNEL_CLASS='App\Shared\Infrastructure\Kernel'
APP_SECRET='$ecretf0rt3st'
APP_SECRET=4dc864551c62905089314503222dccc748
SYMFONY_DEPRECATIONS_HELPER=disabled
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=

J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mxRQTMKWGtKTWtMOWh5enFiZWMyWS9TVklYT2V5U0xIbDVrTWhpclE0c2tFNHdESFo1TWMwTElLZ3NNVVRaNmtEZ1MzRApydjd5em5tc2dNKzlHbGFFUnJWT1lLU3ppaWZ2c3MvLzU2bGxNb0lVOGhvSUtaek1hNEZtcGY5Z0liVzVqYVdHClgza3ZwZHhPV2EvVEpYMm5yQ1kyNTNzQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=
JWT_TOKEN_TTL=3600
JWT_PASSPHRASE=passphrase
5 changes: 5 additions & 0 deletions .env.test.local.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DB_HOST=postgres
DB_NAME=symfony
DB_USER=symfony
DB_PASSWORD=symfony
DB_PORT=5432
73 changes: 73 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 'Staging'

# Событие workflow_run позволяет запускать workflow после завершения другого workflow.
#on:
# workflow_run:
# workflows: ["Test"]
# branches: [main]
# types:
# - completed
on: workflow_dispatch # Событие workflow_dispatch позволяет запускать workflow вручную из интерфейса GitHub.

# Набор заданий в рабочем процессе
jobs:
# Задание сборки образа
build:
# Виртуальная машина, на которой будет выполняться задание
runs-on: ubuntu-latest
# Запускать задание только на главной ветке
if: github.ref == 'refs/heads/main'
# Набор шагов в задании
steps:
# экшен для извлечения репозитория
- name: "Checkout repository"
uses: actions/checkout@v2

# надстройка для виртуализации
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v1

# модуль Docker для сборки образов
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v1

# экшен для логина в Docker Registry (в нашем случае – Github Packages)
- name: "Login to GitHub Registry"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "alejandro-yakovlev"
password: ${{ secrets.REGISTRY_TOKEN }}

# экшен сборки и публикации образа
- name: "Push images to GitHub Container Registry"
uses: docker/build-push-action@v2
with:
push: true
file: ./docker/php-fpm/Dockerfile
tags: |
ghcr.io/${{ github.repository_owner }}/test-ci-cd:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/test-ci-cd:latest
build-args: |
BUILD_MODE=production
# Задание деплоя
deploy:
runs-on: ubuntu-latest
# Запускать задание только после успешного выполнения задания build
needs: build
if: github.ref == 'refs/heads/main'
steps:
# экшен для инициализации подключения по SSH и выполнения скрипта
- name: "Run deploy on server"
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
script: |
echo '${{ secrets.PROD_ENV }}' > /var/www/symfony/.env.local
docker pull ghcr.io/${{ github.repository_owner }}/test-ci-cd:latest
docker stop symfony || true
docker rm -v symfony || true
docker run --env-file /var/www/symfony/.env.local --name symfony -d --restart always -p 880:8080 ghcr.io/${{ github.repository_owner }}/test-ci-cd:latest
83 changes: 83 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: 'Test'

on:
push:
pull_request:

jobs:
analyse:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
ports:
- "5432:5432"
env:
POSTGRES_DB: symfony_db
POSTGRES_USER: symfony_user
POSTGRES_PASSWORD: symfony_pass
env:
POSTGRES_DB: symfony
POSTGRES_USER: symfony
POSTGRES_PASSWORD: symfony
DB_HOST: localhost
DB_NAME: symfony_db
DB_USER: symfony_user
DB_PASSWORD: symfony_pass
DB_PORT: 5432
steps:
- uses: actions/checkout@v2
- name: Build the stack
run: composer install

- name: Run doctrine schema create
run: php bin/console doctrine:schema:create

- name: Run php-cs-fixer
run: php ./vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Run deptrac
run: |
vendor/bin/deptrac analyze deptrac-layers.yaml
vendor/bin/deptrac analyze deptrac-modules.yaml
- name: Run phpstan
run: vendor/bin/phpstan analyse -c phpstan.neon

- name: Run composer validate
run: composer validate --no-check-all --strict

- name: Run doctrine:schema:validate
run: php bin/console doctrine:schema:validate

test:
runs-on: ubuntu-latest
needs: analyse
services:
postgres:
image: postgres:14
ports:
- "5432:5432"
env:
POSTGRES_DB: symfony_db
POSTGRES_USER: symfony_user
POSTGRES_PASSWORD: symfony_pass
env:
POSTGRES_DB: symfony
POSTGRES_USER: symfony
POSTGRES_PASSWORD: symfony
DB_HOST: localhost
DB_NAME: symfony_db
DB_USER: symfony_user
DB_PASSWORD: symfony_pass
DB_PORT: 5432
steps:
- uses: actions/checkout@v2
- name: Build the stack
run: composer install

- name: Run doctrine schema create
run: php bin/console doctrine:schema:create

- name: Run tests
run: php bin/phpunit
Loading

0 comments on commit ae07463

Please sign in to comment.