-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into pgdpetrvs_publico
# Conflicts: # .github/workflows/main.yml
- Loading branch information
Showing
198 changed files
with
16,318 additions
and
6,593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- dataprev_dsv | ||
- dataprev_hmg | ||
- dataprev_treina | ||
- dataprev_producao | ||
pull_request: | ||
branches: | ||
- dataprev_dsv | ||
- dataprev_hmg | ||
- dataprev_treina | ||
- dataprev_producao | ||
jobs: | ||
build_producao: | ||
name: Build on Producao | ||
if: github.ref == 'refs/heads/dataprev_producao' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
working-directory: ./front-end | ||
run: npm install --legacy-peer-deps | ||
|
||
- name: Install Angular CLI | ||
run: npm install -g @angular/cli | ||
|
||
- name: Build Angular and Run Postbuild | ||
working-directory: ./front-end | ||
run: | | ||
ng build --configuration=production --output-path=../back-end/public | ||
node ./postbuild.js | ||
- name: Build Producao | ||
env: | ||
DOCKER_HUB_IMAGE: segescginf/pgdpetrvs | ||
DOCKER_HUB_TAG_LATEST: latest | ||
DOCKER_HUB_TAG_NEW: 2.1.0 | ||
DOCKER_HUB_TAG_OLD: 2.0.17 | ||
DOCKER_HUB_USERNAME: segescginf | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
DEPLOY_PATH: ./ | ||
run: | | ||
echo "Iniciando a construção e envio das imagens Docker..." | ||
# Autentica no Docker Hub | ||
echo $DOCKER_HUB_PASSWORD | docker login -u $DOCKER_HUB_USERNAME --password-stdin | ||
# Função para verificar se uma tag existe no Docker Hub | ||
tag_exists() { | ||
curl --silent -f -lSL "https://hub.docker.com/v2/repositories/$DOCKER_HUB_IMAGE/tags/$1/" > /dev/null | ||
} | ||
# Puxa a imagem atual com a tag DOCKER_HUB_TAG_LATEST | ||
docker pull $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_LATEST | ||
# Verifica se a tag $DOCKER_HUB_TAG_OLD já existe, e só reetiqueta se não existir | ||
if tag_exists $DOCKER_HUB_TAG_OLD; then | ||
echo "A tag $DOCKER_HUB_TAG_OLD já existe, não será reetiquetada." | ||
else | ||
docker tag $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_LATEST $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_OLD | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_OLD | ||
fi | ||
# Constrói a nova imagem com a tag $DOCKER_HUB_TAG_NEW | ||
docker build -t $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_NEW -f ./resources/dataprev/dev/Dockerfile . | ||
# Etiqueta a nova imagem como DOCKER_HUB_TAG_LATEST | ||
docker tag $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_NEW $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_LATEST | ||
# Envia as novas tags para o Docker Hub | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_NEW | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG_LATEST | ||
echo "Envio das imagens Docker concluído." | ||
build_and_deploy_dsv: | ||
name: Build and Deploy on Dataprev DSV | ||
if: github.ref == 'refs/heads/dataprev_dsv' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
working-directory: ./front-end | ||
run: npm install --legacy-peer-deps | ||
|
||
- name: Install Angular CLI | ||
run: npm install -g @angular/cli | ||
|
||
- name: Build Angular and Run Postbuild | ||
working-directory: ./front-end | ||
run: | | ||
ng build --configuration=production --output-path=../back-end/public | ||
node ./postbuild.js | ||
- name: Build and Deploy DSV | ||
env: | ||
DOCKER_HUB_IMAGE: segescginf/pgdpetrvs-develop | ||
DOCKER_HUB_TAG: dsv | ||
SSH_USER: root | ||
SSH_HOST: 200.152.38.137 | ||
SSH_PORT: 7223 | ||
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD_DSV }} | ||
DEPLOY_PATH: ./ | ||
DOCKER_HUB_USERNAME: segescginf | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
run: | | ||
echo "Iniciando a construção e implantação do DSV..." | ||
echo "Construindo a imagem Docker..." | ||
docker build -t $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG -f ./resources/dataprev/dev/Dockerfile . | ||
echo "Construção da imagem concluída. Enviando para o Docker Hub..." | ||
echo $DOCKER_HUB_PASSWORD | docker login -u $DOCKER_HUB_USERNAME --password-stdin | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG | ||
echo "Envio da imagem Docker concluído. Iniciando implantação no servidor remoto..." | ||
sudo apt-get update -y && sudo apt-get install -y sshpass | ||
sshpass -p $SSH_PASSWORD ssh -T -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SSH_HOST "cd /home/marcocoelho/ && bash install-pgd.sh < /dev/null" | ||
echo "Implantação concluída com sucesso em DSV." | ||
build_and_deploy_hmg: | ||
name: Build and Deploy on Dataprev HMG | ||
if: github.ref == 'refs/heads/dataprev_hmg' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
working-directory: ./front-end | ||
run: npm install --legacy-peer-deps | ||
|
||
- name: Install Angular CLI | ||
run: npm install -g @angular/cli | ||
|
||
- name: Build Angular and Run Postbuild | ||
working-directory: ./front-end | ||
run: | | ||
ng build --configuration=production --output-path=../back-end/public | ||
node ./postbuild.js | ||
- name: Build and Deploy HMG | ||
env: | ||
DOCKER_HUB_IMAGE: segescginf/pgdpetrvs-develop | ||
DOCKER_HUB_TAG: hmg | ||
SSH_USER: root | ||
SSH_HOST: 200.152.38.137 | ||
SSH_PORT: 7222 | ||
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD_HMG }} | ||
DEPLOY_PATH: ./ | ||
DOCKER_HUB_USERNAME: segescginf | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
run: | | ||
echo "Iniciando a construção e implantação do HMG..." | ||
echo "Construindo a imagem Docker..." | ||
docker build -t $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG -f ./resources/dataprev/dev/Dockerfile . | ||
echo "Construção da imagem concluída. Enviando para o Docker Hub..." | ||
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG | ||
echo "Envio da imagem Docker concluído. Iniciando implantação no servidor remoto..." | ||
sudo apt-get update -y && sudo apt-get install -y sshpass | ||
# Executando o script install-pgd.sh | ||
sshpass -p $SSH_PASSWORD ssh -T -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SSH_HOST "sh install-pgd.sh < /dev/null" | ||
echo "Implantação concluída com sucesso em HMG." | ||
build_and_deploy_treina: | ||
name: Build and Deploy on Dataprev TREINA | ||
if: github.ref == 'refs/heads/dataprev_treina' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
working-directory: ./front-end | ||
run: npm install --legacy-peer-deps | ||
|
||
- name: Install Angular CLI | ||
run: npm install -g @angular/cli | ||
|
||
- name: Build Angular and Run Postbuild | ||
working-directory: ./front-end | ||
run: | | ||
ng build --configuration=production --output-path=../back-end/public | ||
node ./postbuild.js | ||
- name: Build and Deploy TREINA | ||
env: | ||
DOCKER_HUB_IMAGE: segescginf/pgdpetrvs-develop | ||
DOCKER_HUB_TAG: treina | ||
SSH_USER: root | ||
SSH_HOST: 200.152.38.137 | ||
SSH_PORT: 7228 | ||
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD_TREINA }} | ||
DEPLOY_PATH: ./ | ||
DOCKER_HUB_USERNAME: segescginf | ||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
run: | | ||
echo "Iniciando a construção e implantação do TREINA..." | ||
echo "Construindo a imagem Docker..." | ||
docker build -t $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG -f ./resources/dataprev/dev/Dockerfile . | ||
echo "Construção da imagem concluída. Enviando para o Docker Hub..." | ||
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD | ||
docker push $DOCKER_HUB_IMAGE:$DOCKER_HUB_TAG | ||
echo "Envio da imagem Docker concluído. Iniciando implantação no servidor remoto..." | ||
sudo apt-get update -y && sudo apt-get install -y sshpass | ||
# Executando o script install-pgd.sh | ||
sshpass -p $SSH_PASSWORD ssh -T -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SSH_HOST "sh install-pgd.sh < /dev/null" | ||
echo "Implantação concluída com sucesso em TREINA." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## 2.1.0 - 06/09/2024 | ||
### Adicionado | ||
- Campo para informar a unidade autorizadora no regramento. | ||
- Opção para clonar Planos de Trabalho e Planos de Entrega. | ||
- Adicionado nível de "Configurador" do tenant | ||
- Adiciona Auditoria do Sistema | ||
- Adição de campos para informar usuário e senha da API PGD nos Tenants | ||
### Corrigido | ||
- Correção para refletir afastamentos nos registros de execução. | ||
- Correção para incluir Planos de Trabalho no mesmo dia de início do regramento. | ||
- Correção na regra para bloquear Planos de Trabalho com datas sobrepostas | ||
- Correção do cadastro do tenant | ||
- Correção no login da Azure(Microsoft) | ||
### Removido | ||
- Arquivos de documentação. Documentação oficial será no site do PGD | ||
- Acesso direto ao SIAPE | ||
### Modificado | ||
- Remoção do caracter '#' dos endereços (URL) do sistema | ||
- Modificação no acesso aos dados do SIAPE, alterando de conexão direta ao SIAPE para o conectaGov, no painel do administrador deverá ser alterado a rota e inserido a chave e senha. | ||
- Alterado a forma que é definição de chefia e chefia substituta no sistema, se baseando nos campos advindos do SIAPE | ||
### Segurança | ||
### Obsoleto | ||
### Não Publicado | ||
- Exportação de dados para o Programa de Gestão - PGD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use App\Services\API_PGD\Export\ExportarTenantService; | ||
|
||
class EnviaDadosApiPGD extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'job:envia-api-pgd {tenant}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Envia para API do PGD dados do Petrvs'; | ||
|
||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle(ExportarTenantService $exportarTenantService) | ||
{ | ||
$tenant = $this->argument('tenant'); | ||
|
||
$exportarTenantService->exportar($tenant); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Enums; | ||
|
||
enum Atribuicao: string | ||
{ | ||
case COLABORADOR = 'COLABORADOR'; | ||
case GESTOR = 'GESTOR'; | ||
case LOTADO = 'LOTADO'; | ||
case GESTOR_SUBSTITUTO = 'GESTOR_SUBSTITUTO'; | ||
case DELEGADO = 'DELEGADO'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
namespace App\Exceptions; | ||
|
||
use App\Exceptions\Contracts\IBaseException; | ||
use Exception; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class BadRequestException extends Exception implements IBaseException | ||
{ | ||
public function __construct($message = "", $code = Response::HTTP_BAD_REQUEST, Exception $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
|
||
class ExportPgdException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
|
||
|
||
class RequestConectaGovException extends Exception | ||
{ | ||
public function __construct($message = "Erro ao tentar se conectar com o ConectaGov", $code = 0, Exception $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
Oops, something went wrong.