Skip to content

Commit

Permalink
Adiciona pipeline para teste e publicacao da imagem docker
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirola committed Jul 4, 2024
1 parent eea3bc5 commit 78a4c71
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 238 deletions.
99 changes: 63 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,73 @@
name: ci
name: CI

on:
pull_request:
push:
branches:
- homolog
- develop
pull_request: ~
workflow_dispatch: ~

workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
BUILD:
tests:
name: Tests
runs-on: ubuntu-latest
steps:

- uses: actions/[email protected]

- name: Docker Login
uses: docker/[email protected]
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build Docker images
uses: docker/bake-action@v4
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Checkout submodules
run: git submodule update --init --recursive

- name: Ajusta branch do MultipleLocalAuth
run: cd src/plugins/MultipleLocalAuth && git checkout v3.0.0

- name: Criação da Imagem docker
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
tags: |
secultceara/mapascultural:7.3.7
secultceara/mapascultural:latest
DEPLOY:
needs: BUILD
runs-on: mapahomolog
pull: true
load: true
files: |
compose.yaml
compose.override.yaml
set: |
*.cache-from=type=gha,scope=${{github.ref}}
*.cache-from=type=gha,scope=refs/heads/main
*.cache-to=type=gha,scope=${{github.ref}},mode=max
-
name: Start services
run: docker compose up --wait --no-build
-
name: Check HTTP reachability
run: curl -v --fail-with-body http://localhost
# -
# name: Check API reachability
# run: curl -vk --fail-with-body https://localhost
# -
# name: Check PWA reachability
# run: "curl -vk --fail-with-body -H 'Accept: text/html' https://localhost"
-
name: Create test database
run: docker compose exec -T php bin/console -e test doctrine:database:create
-
name: Run migrations
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
-
name: Run PHPUnit
run: docker compose exec -T php bin/phpunit
-
name: Doctrine Schema Validator
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
lint:
name: Docker Lint
runs-on: ubuntu-latest
steps:
- name: Pull das imagens docker
run: cd /opt/docker/mapa7 && sudo docker-compose pull
- name: Restart do docker-compose para atualizar o container com a nova imagem
run: cd /opt/docker/mapa7 && sudo docker-compose down && sudo docker-compose up -d
-
name: Checkout
uses: actions/checkout@v4
-
name: Lint Dockerfiles
uses: hadolint/[email protected]
with:
recursive: true
60 changes: 0 additions & 60 deletions .github/workflows/cicd-dev.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/workflows/ci.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/workflows/release.yml

This file was deleted.

2 changes: 2 additions & 0 deletions api/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ doctrine:

profiling_collect_backtrace: '%kernel.debug%'
use_savepoints: true
mapping_types:
enum: string
orm:
auto_generate_proxy_classes: true
enable_lazy_ghost_objects: true
Expand Down
File renamed without changes.
File renamed without changes.
47 changes: 29 additions & 18 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- ./api:/app
# - /app/var
- var-files:/app/var
# - ./api/frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
# - ./api/frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
- ./api/frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
- ./api/frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
- caddy_data:/data
- caddy_config:/config

Expand All @@ -47,6 +47,17 @@ services:
published: 5020
protocol: tcp

# pgadmin:
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
# PGADMIN_CONFIG_SERVER_MODE: 'False'
# volumes:
# - pgadmin:/var/lib/pgadmin
# ports:
# - 5050:80

recreate-pending-pcache:
extends:
service: php
Expand Down Expand Up @@ -91,24 +102,23 @@ services:
volumes:
- sessions:/data

mailhog:
image: mailhog/mailhog
# ports:
# - "8025:8025"
# mailhog:
# image: mailhog/mailhog
# ports:
# - "8025:8025"

# pwa:
# image: redemapas/mapas-pwa
# build:
# context: ./pwa
# target: dev
# volumes:
# - ./pwa:/srv/app
# environment:
# API_PLATFORM_CREATE_CLIENT_ENTRYPOINT: http://php
# API_PLATFORM_CREATE_CLIENT_OUTPUT: .
# NEXT_PUBLIC_ENTRYPOINT: http://php
pwa:
image: redemapas/mapas-pwa
build:
context: ./pwa
target: dev
volumes:
- ./pwa:/srv/app
environment:
API_PLATFORM_CREATE_CLIENT_ENTRYPOINT: http://php
API_PLATFORM_CREATE_CLIENT_OUTPUT: .
NEXT_PUBLIC_ENTRYPOINT: http://php

###> doctrine/doctrine-bundle ###
database:
image: kartoza/postgis:14
environment:
Expand All @@ -131,3 +141,4 @@ volumes:
db_data:
sessions:
redis:
pgadmin:

0 comments on commit 78a4c71

Please sign in to comment.