Commit e7d1ab1c authored by Rafael's avatar Rafael

Altera arquivo de CI.

parent 515acaff
Pipeline #7947 failed with stage
variables:
BUILD_ENVIROMENT_DIR: $CI_BUILDS_DIR\ambiente-de-build
BUILD_ENVIROMENT_CONFIG_FILE_PATH: $CI_BUILDS_DIR\ambiente-de-build\GerarPacoteEnvio.config
BUILD_FRAMEWORK_DCUS_DIR: $CI_BUILDS_DIR\ambiente-de-build\curio\v1_8_6_12
CURIO_VERSION: '1.8.6.12'
CI_COMMIT_MESSAGE: '$CI_COMMIT_MESSAGE'
ARTIFACT_NAME: 'SGS_${CI_COMMIT_TAG}'
PROJECT_ID: 'idexa%2FSGS'
PROJECT_TOKEN: '3CQevZshNAKWPckKBYNS'
OID_CLIENTE_SISCON: '40'
CONFIG_XML_PATH: Comum\bin\sgs.xml
stages: stages:
- prebuild
- prebuildtest
- buildweb
- build - build
- test - delivery
- deploy_internally
- deploy - deploy
- badge - badges
.only_build: &only_build variables:
stage: build LC_ALL: 'en_US.UTF-8'
tags: LANG: 'en_US.UTF-8'
- delphi
variables: .has_no_tags: &has_no_tags
GIT_STRATEGY: fetch
only: only:
- branches - branches
except: except:
- tags - tags
- develop
.build_and_distribute: &build_and_distribute .version: &version
stage: build
tags:
- delphi
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /.*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/
except:
variables:
- $CI_COMMIT_TAG =~ /autopop/
update_ambiente_build:
stage: prebuild
tags:
- delphi
when: manual
tags:
- delphi
variables:
GIT_STRATEGY: none
script:
- git reset --hard
- git -C ${BUILD_ENVIROMENT_DIR} reset --hard
- git -C ${BUILD_ENVIROMENT_DIR} pull
except:
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev/
- $CI_COMMIT_TAG =~ /autopop\/homolog/
- $CI_COMMIT_TAG =~ /autopop\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
update_scriptBuild_CurioBuild:
stage: prebuild
tags:
- delphi
when: manual
tags:
- delphi
variables:
GIT_STRATEGY: none
script:
- pip install --upgrade CurioBuild
except:
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev/
- $CI_COMMIT_TAG =~ /autopop\/homolog/
- $CI_COMMIT_TAG =~ /autopop\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
update_local_tags:
stage: prebuild
tags:
- delphi
when: manual
variables:
GIT_STRATEGY: none
script:
- git tag -d $(git tag -l)
- git fetch
except:
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev/
- $CI_COMMIT_TAG =~ /autopop\/homolog/
- $CI_COMMIT_TAG =~ /autopop\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.autopop_cli: &autopop_cli
before_script: before_script:
# Version # Version
- Version=`echo "$CI_COMMIT_TAG" | (cut -d'/' -f 4 )` - Version=`echo "$CI_COMMIT_TAG" | (cut -d'/' -f 2 )`
- echo $Version - echo $Version
- MajorVersion=`echo "$Version" | (cut -d'.' -f 1 )`.`echo "$Version" | (cut -d'.' -f 2 )`
- echo $MajorVersion
- BuildNumber=`echo "$Version" | (cut -d'.' -f 3 )`
- echo $BuildNumber
- TagMessage=`git tag -l $CI_COMMIT_TAG --format='%(subject)'`
- echo $TagMessage
# Set Version
- json -I -f AutoPop/cli/web/corretor/package.json -e "this.version='$Version'"
# Set Registry
- yarn config set registry https://nexus.dev.evologica.com.br/repository/npm/
.autopop_cli_pacote: &autopop_cli_pacote .web: &web
tags:
- web
before_script: before_script:
# Version # Version
- Version=`echo "$CI_COMMIT_TAG" | (cut -d'/' -f 2 )` - Version=`echo "$CI_COMMIT_TAG" | (cut -d'/' -f 3 )`
- echo $Version - echo $Version
- MajorVersion=`echo "$Version" | (cut -d'.' -f 1 )`.`echo "$Version" | (cut -d'.' -f 2 )` - VersionCode=`echo "$Version" | (cut -d'.' -f 1 )``echo "$Version" | (cut -d'.' -f 2 )``echo "$Version" | (cut -d'.' -f 3 )`
- echo $MajorVersion - echo $VersionCode
- BuildNumber=`echo "$Version" | (cut -d'.' -f 3 )`
- echo $BuildNumber
- TagMessage=`git tag -l $CI_COMMIT_TAG --format='%(subject)'`
- echo $TagMessage
# Set Version
- json -I -f AutoPop/cli/web/corretor/package.json -e "this.version='$Version'"
# Set Registry
- yarn config set registry https://nexus.dev.evologica.com.br/repository/npm/
#-----------------------------------------------------------------------------------#
#-----------------------------IDENTIFICAÇÃO DE TAGS---------------------------------#
#-----------------------------------------------------------------------------------#
.has_tag_autopop_cli_pacote: &has_tag_autopop_cli_pacote
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_srv: &has_tag_autopop_srv
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/srv\/(\w+(,\w+)*\/)?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_dev_cli_banseg: &has_tag_autopop_dev_cli_banseg
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev\/banseg\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_dev_cli_banescor: &has_tag_autopop_dev_cli_banescor
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev\/banescor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_dev_cli_corretor: &has_tag_autopop_dev_cli_corretor #################################################################################################
only: # TAG IDENTIFICATION #
refs: #################################################################################################
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev\/corretor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_dev_cli_segcor: &has_tag_autopop_dev_cli_segcor .has_tag_cliente_web: &has_tag_cliente_web
only: stage: deploy
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev\/seguradoCorretor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_dev_cli_segurado: &has_tag_autopop_dev_cli_segurado
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev\/segurado\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_homolog_cli_banseg: &has_tag_autopop_homolog_cli_banseg
only:
refs:
- tags
variables:
- $CI_COMMIT_TAG =~ /autopop\/homolog\/banseg\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
.has_tag_autopop_homolog_cli_banescor: &has_tag_autopop_homolog_cli_banescor
only: only:
refs: refs:
- tags - tags
variables: variables:
- $CI_COMMIT_TAG =~ /autopop\/homolog\/banescor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ - $CI_COMMIT_TAG =~ /AppCliente[/]web[/][0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/
.has_tag_autopop_homolog_cli_corretor: &has_tag_autopop_homolog_cli_corretor .has_tag_agente_web: &has_tag_agente_web
stage: deploy
only: only:
refs: refs:
- tags - tags
variables: variables:
- $CI_COMMIT_TAG =~ /autopop\/homolog\/corretor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ - $CI_COMMIT_TAG =~ /AppAgente[/]web[/][0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/
.has_tag_autopop_homolog_cli_segcor: &has_tag_autopop_homolog_cli_segcor .has_tag_api_internal: &has_tag_api_internal
stage: deploy
only: only:
refs: refs:
- tags - tags
variables: variables:
- $CI_COMMIT_TAG =~ /autopop\/homolog\/seguradoCorretor\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ - $CI_COMMIT_TAG =~ /api[/][0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/
.has_tag_autopop_homolog_cli_segurado: &has_tag_autopop_homolog_cli_segurado .has_tag_server: &has_tag_server
stage: deploy
only: only:
refs: refs:
- tags - tags
variables: variables:
- $CI_COMMIT_TAG =~ /autopop\/homolog\/segurado\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ - $CI_COMMIT_TAG =~ /srv[/][0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/
#-----------------------------------------------------------------------------------#
#-----------------------GERAR CONFIGURAÇÃO SISTEMA DO SISCON------------------------#
#-----------------------------------------------------------------------------------#
.config_xml: &config_xml
only:
- branches
- tags
except:
variables:
- $CI_COMMIT_TAG =~ /autopop\/dev/
- $CI_COMMIT_TAG =~ /autopop\/homolog/
- $CI_COMMIT_TAG =~ /autopop\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/
tags:
- delphi
#################################################################################################
# Android APP BUILD #
#################################################################################################
generate_config_xml: .build_app_cliente_web: &build_app_cliente_web
<<: *config_xml
stage: prebuild
variables:
GIT_STRATEGY: none
before_script: before_script:
- New-Item -ItemType Directory -Force -Path Comum - cd cli/web/cliente
- New-Item -ItemType Directory -Force -Path Comum\bin
script:
- python ${BUILD_ENVIROMENT_DIR}\scriptsCI\generate_system_xml_config.py ${BUILD_ENVIROMENT_DIR} $OID_CLIENTE_SISCON $CI_COMMIT_REF_NAME $CONFIG_XML_PATH
artifacts:
# expose_as: 'servico' # Not avaliable until gitlab version 12.5
name: sgs.xml
expire_in: 5 hours
paths:
- Comum\bin\sgs.xml
test_config_xml:
<<: *config_xml
stage: prebuildtest
variables:
EXE: $CI_BUILDS_DIR\ambiente-de-build\bin\VerificadorMenu.exe
dependencies:
- generate_config_xml
script:
- verificadorMsg $CONFIG_XML_PATH .
- echo "$EXE -XML $CONFIG_XML_PATH -DIR . -R .\BaseDetran\"
- Invoke-Expression "$EXE -XML $CONFIG_XML_PATH -DIR . -R .\BaseDetran\"
after_script:
- cat .\LogMsgErroNaoCadastradas.txt
.web: &web
tags:
- autopop
script:
- yarn --version
- node -v
- rm -rf _pacote_web
- mkdir _pacote_web
- cd AutoPop/cli/web/corretor
- json -I -f package.json -e "this.version='$Version'"
- yarn - yarn
# Buildar segurado - yarn build
- yarn build:segurado:homologBanestes
- rm -f dist/cotacao/config.json
- mv dist/cotacao ../../../../_pacote_web/cotacao
# Buildar banescor
- yarn build:banescor:homologBanestes
- rm -f dist/banescor/config.json
- mv dist/banescor ../../../../_pacote_web/banescor
# Buildar banseg
- yarn build:banseg:homologBanestes
- rm -f dist/banseg/config.json
- mv dist/banseg ../../../../_pacote_web/banseg
# Buildar corretor
- yarn build:corretor:homologBanestes
- rm -f dist/corretor/config.json
- mv dist/corretor ../../../../_pacote_web/corretor
# Buildar segurado corretor
- yarn build:segcor:homologBanestes
- rm -f dist/segcor/config.json
- mv dist/segcor ../../../../_pacote_web/segcor
- rm -rf node_modules/*
#-----------------------------------------------------------------------------------#
#---------------------------------------BUILD---------------------------------------#
#-----------------------------------------------------------------------------------#
build_server:
<<: *only_build
dependencies:
- generate_config_xml
before_script:
- md server
script:
- dir C:\GitLabRunner\builds\ambiente-de-build\curio\v1_8_6_12\srv\
- python .\build\GerarPacote.py build_servico --project_root_directory="." --output_directory="server" --build_directory="$BUILD_ENVIROMENT_DIR" --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dcus_curio_directory="$BUILD_FRAMEWORK_DCUS_DIR" --skip_pause_between_steps --skip_msg_verification --skip_menu_verification -sql=auto --debug
build_client:
<<: *only_build
before_script:
- md client
script:
- python .\build\GerarPacote.py build_cliente --project_root_directory="." --output_directory="client" --build_directory="$BUILD_ENVIROMENT_DIR" --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dcus_curio_directory="$BUILD_FRAMEWORK_DCUS_DIR" --skip_pause_between_steps --debug
build_web:
<<: *only_build
<<: *web
stage: build
when: manual
after_script:
- echo "fim"
build_all:
<<: *build_and_distribute
before_script:
- md _pacote_destino
dependencies:
- generate_config_xml
script:
- $TAG_MESSAGE=(git tag -l $CI_COMMIT_TAG --format='%(subject)')
- echo $TAG_MESSAGE
- python .\build\GerarPacote.py build_all --project_root_directory="." --output_directory="_pacote_destino" --build_directory="$BUILD_ENVIROMENT_DIR" --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dcus_curio_directory="$BUILD_FRAMEWORK_DCUS_DIR" --skip_pause_between_steps --skip_msg_verification --skip_menu_verification -sql=auto --release_notes=$TAG_MESSAGE --tag_text=$env:CI_COMMIT_TAG --debug
artifacts: artifacts:
# expose_as: 'servico' # Not avaliable until gitlab version 12.5 name: dist
name: $ARTIFACT_NAME
expire_in: 1 week
paths: paths:
- _pacote_destino - cli/web/cliente/dist
expire_in: 2 weeks
#-----------------------------------------------------------------------------------#
#-----------------------------------DEPLOY AutoPop----------------------------------#
#-----------------------------------------------------------------------------------#
build_autopop_web:
<<: *has_tag_autopop_cli_pacote
<<: *web
<<: *autopop_cli_pacote
stage: buildweb
artifacts:
# expose_as: 'servico' # Not avaliable until gitlab version 12.5
name: $ARTIFACT_NAME
expire_in: 1 week
paths:
- _pacote_web
build_autopop_srv:
<<: *has_tag_autopop_srv
stage: build
tags:
- delphi
before_script:
- md _pacote_destino
dependencies:
- generate_config_xml
script:
- $TAG_MESSAGE=(git tag -l $CI_COMMIT_TAG --format='%(subject)')
- echo $TAG_MESSAGE
- python .\build\GerarPacoteAutopop.py build --project_root_directory="." --output_directory="_pacote_destino" --build_directory="$BUILD_ENVIROMENT_DIR" --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dcus_curio_directory="$BUILD_FRAMEWORK_DCUS_DIR" --skip_pause_between_steps --skip_msg_verification --skip_menu_verification -sql=auto --release_notes="Atualização Autopop" --tag_text=$env:CI_COMMIT_TAG --debug
artifacts:
# expose_as: 'servico' # Not avaliable until gitlab version 12.5
name: $ARTIFACT_NAME
expire_in: 1 week
paths:
- _pacote_destino
build_autopop_dev_cli_corretor:
<<: *has_tag_autopop_dev_cli_corretor
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:corretor:staging
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopCorretor/
after_script:
- rm node_modules
- rm dist
build_autopop_dev_cli_banseg:
<<: *has_tag_autopop_dev_cli_banseg
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:banseg:staging
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopop_dev/
after_script:
- rm node_modules
- rm dist
build_autopop_dev_cli_banescor:
<<: *has_tag_autopop_dev_cli_banescor
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:banescor:staging
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopBanescor/
after_script:
- rm node_modules
- rm dist
build_autopop_dev_cli_segcor:
<<: *has_tag_autopop_dev_cli_segcor
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:segcor:staging
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopCliente/corretor
after_script:
- rm node_modules
- rm dist
build_autopop_dev_cli_segurado:
<<: *has_tag_autopop_dev_cli_segurado
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:segurado:staging
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopCliente/segurado
after_script:
- rm node_modules
- rm dist
build_autopop_homolog_cli_corretor:
<<: *has_tag_autopop_homolog_cli_corretor
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:corretor:homolog
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopHomolog/corretor/
after_script: after_script:
- rm node_modules - rm node_modules
- rm dist - rm dist
build_autopop_homolog_cli_banseg:
<<: *has_tag_autopop_homolog_cli_banseg
<<: *autopop_cli
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn
- yarn build:banseg:homolog
# Copiar dist pro diretório do container
- cp -R dist ~/services/autopopHomolog/banseg/
after_script:
- rm node_modules
- rm dist
build_autopop_homolog_cli_banescor: deploy_app_cliente_web:
<<: *has_tag_autopop_homolog_cli_banescor <<: *has_tag_cliente_web
<<: *autopop_cli <<: *web
stage: build <<: *build_app_cliente_web
tags:
- autopop
script: script:
# Build - cp -R cli/web/cliente/dist ~/services/agiliza/cliente
- cd AutoPop/cli/web/corretor/ artifacts:
- yarn name: dist
- yarn build:banescor:homolog paths:
# Copiar dist pro diretório do container - cli/web/cliente/dist
- cp -R dist ~/services/autopopHomolog/banescor/ expire_in: 2 weeks
after_script: after_script:
- rm node_modules - rm node_modules
- rm dist - rm dist
build_autopop_homolog_cli_segcor: .build_app_agente_web: &build_app_agente_web
<<: *has_tag_autopop_homolog_cli_segcor before_script:
<<: *autopop_cli - cd cli/web/agente
stage: build
tags:
- autopop
script:
# Build
- cd AutoPop/cli/web/corretor/
- yarn - yarn
- yarn build:segcor:homolog - yarn build
# Copiar dist pro diretório do container artifacts:
- cp -R dist ~/services/autopopClienteHomolog/corretor name: dist
paths:
- cli/web/agente/dist
expire_in: 2 weeks
after_script: after_script:
- rm node_modules - rm node_modules
- rm dist - rm dist
build_autopop_homolog_cli_segurado: deploy_app_cliente_web:
<<: *has_tag_autopop_homolog_cli_segurado <<: *web
<<: *autopop_cli <<: *has_tag_agente_web
stage: build <<: *build_app_agente_web
tags:
- autopop
script: script:
# Build - cp -R cli/web/cliente/dist ~/services/agiliza/cliente
- cd AutoPop/cli/web/corretor/ artifacts:
- yarn name: dist
- yarn build:segurado:homolog paths:
# Copiar dist pro diretório do container - cli/web/cliente/dist
- cp -R dist ~/services/autopopClienteHomolog/segurado expire_in: 2 weeks
after_script: after_script:
- rm node_modules - rm node_modules
- rm dist - rm dist
#################################################################################################
#-----------------------------------------------------------------------------------# # SERVER BUILD #
#---------------------------------------DEPLOY--------------------------------------# #################################################################################################
#-----------------------------------------------------------------------------------# # .server_build_i: &server_build_i
copy_package_to_server: # tags:
<<: *build_and_distribute # - rhel7
stage: deploy_internally # variables:
variables: # SRV_DIR: srv/src/microcredito/
GIT_STRATEGY: none # DOCKER_REGISTRY: dockerhub.dev.evologica.com.br
PATH_DEPLOY: \\srp1vp1\Publico\Pacotes\SGS # script:
FILE_NAME_DEPLOY: ${CI_COMMIT_TAG} # - cd $SRV_DIR
dependencies: # - chmod +x gradlew
- build_all # - ./gradlew spotlessJavaApply
script: # - ./gradlew assemble
- python ${BUILD_ENVIROMENT_DIR}\scriptsCI\compress_file.py ${BUILD_ENVIROMENT_CONFIG_FILE_PATH} _pacote_destino $PATH_DEPLOY $FILE_NAME_DEPLOY
# server_build_test:
publish_to_orquestra: # <<: *has_no_tags
<<: *build_and_distribute # <<: *server_build_i
stage: deploy # stage: fast_test
variables:
GIT_STRATEGY: none # server_build:
when: manual # <<: *server_build_i
script: # stage: build
- dir _pacote_destino\opkg # script:
- python build\GerarPacote.py enviar_opkg --debug --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dir_opkg="_pacote_destino\opkg" --app_ids="$ORQUESTRA_APP_IDS" --connection_string="$ORQUESTRA_CONNECTION_STRING" # - cd $SRV_DIR
dependencies: # - chmod +x gradlew
- build_all # - ./gradlew spotlessJavaApply
# - ./gradlew build
copy_autopop_package_to_server: # after_script:
<<: *has_tag_autopop_cli_pacote # - mv srv/src/microcredito/configuration/build/libs/configuration-*.jar microcredito.jar
stage: deploy_internally # artifacts:
tags: # name: srv
- delphi # paths:
variables: # - microcredito*.jar
GIT_STRATEGY: none # only:
PATH_DEPLOY: \\srp1vp1\Publico\Pacotes\SGS # - develop
FILE_NAME_DEPLOY: ${CI_COMMIT_TAG}
dependencies: # server_delivery:
- build_autopop_web # <<: *version
script: # <<: *has_tag_server
- python ${BUILD_ENVIROMENT_DIR}\scriptsCI\compress_file.py ${BUILD_ENVIROMENT_CONFIG_FILE_PATH} _pacote_web $PATH_DEPLOY $FILE_NAME_DEPLOY # <<: *server_build_i
# stage: delivery
publish_autopop_to_orquestra: # script:
<<: *has_tag_autopop_srv # # Seta variaveis
# - JAR_NAME=microcredito-$Version.jar
# - DOCKER_IMAGE_NAME=microcredito:$Version
# - DOCKER_PUSH_TARGET=$DOCKER_REGISTRY/$DOCKER_IMAGE_NAME
# - echo $JAR_NAME
# - echo $DOCKER_IMAGE_NAME
# - echo $DOCKER_PUSH_TARGET
# # Build
# - cd $SRV_DIR
# - chmod +x gradlew
# - ./gradlew spotlessJavaApply
# - ./gradlew build
# - cd ../../..
# - mv srv/src/microcredito/configuration/build/libs/configuration-*.jar $JAR_NAME
# # Gera o dockerfile
# - echo "FROM adoptopenjdk/openjdk8:alpine-jre" > Dockerfile
# - echo "" >> Dockerfile
# - echo "ARG JAR_FILE=$JAR_NAME" >> Dockerfile
# - echo "" >> Dockerfile
# - echo "WORKDIR /opt/app" >> Dockerfile
# - echo "" >> Dockerfile
# - echo "COPY \${JAR_FILE} app.jar" >> Dockerfile
# - echo "" >> Dockerfile
# - echo "ENTRYPOINT [\"java\",\"-jar\",\"app.jar\"]" >> Dockerfile
# # Gera o docker com a imagem
# - docker image build -t $DOCKER_PUSH_TARGET .
# # - docker tag $DOCKER_IMAGE_NAME $DOCKER_PUSH_TARGET
# - docker image push $DOCKER_PUSH_TARGET
# after_script:
# - docker rmi $DOCKER_IMAGE_NAME
# - docker rmi $DOCKER_PUSH_TARGET
# after_script:
# - mv srv/src/microcredito/configuration/build/libs/configuration-*.jar microcredito-$Version.jar
# artifacts:
# name: srv
# paths:
# - microcredito*.jar
server_deploy:
<<: *version
<<: *has_tag_server
stage: deploy stage: deploy
tags: tags:
- delphi - rhel7
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
when: manual DOCKER_REGISTRY: dockerhub.dev.evologica.com.br
script:
- dir _pacote_destino\opkg
- python build\GerarPacoteAutopop.py enviar_opkg_autopop --debug --build_config_path="$BUILD_ENVIROMENT_CONFIG_FILE_PATH" --dir_opkg="_pacote_destino\opkg" --app_ids="$ORQUESTRA_APP_IDS" --connection_string="$ORQUESTRA_EVO_CONNECTION_STRING" --tag_text=$env:CI_COMMIT_TAG
dependencies:
- build_autopop_srv
deploy_autopop_dev_cli_corretor:
<<: *has_tag_autopop_dev_cli_corretor
stage: deploy
tags:
- autopop
script:
- cd ~/services/autopopCorretor/
- docker stop AutoPopCorretor
- docker rm AutoPopCorretor
- docker-compose up -d
deploy_autopop_dev_cli_banseg:
<<: *has_tag_autopop_dev_cli_banseg
stage: deploy
tags:
- autopop
script:
- cd ~/services/autopop_dev/
- docker stop AutoPop
- docker rm AutoPop
- docker-compose up -d
deploy_autopop_dev_cli_banescor:
<<: *has_tag_autopop_dev_cli_banescor
stage: deploy
tags:
- autopop
script: script:
- cd ~/services/autopopBanescor/ - DOCKER_IMAGE_NAME=$DOCKER_REGISTRY/microcredito:$Version
- docker stop AutoPopBanescor - echo $DOCKER_IMAGE_NAME
- docker rm AutoPopBanescor - docker image pull $DOCKER_IMAGE_NAME
- docker-compose up -d - docker stop microcredito
- docker rm microcredito
- docker run -d --name microcredito --expose 8080 -p 8080:8080 --restart unless-stopped $DOCKER_IMAGE_NAME
deploy_autopop_dev_cli_segcor: #################################################################################################
<<: *has_tag_autopop_dev_cli_segcor # API #
stage: deploy #################################################################################################
tags:
- autopop
script:
- cd ~/services/autopopCliente/corretor
- docker stop AutoPopClienteCorretor
- docker rm AutoPopClienteCorretor
- docker-compose up -d
deploy_autopop_dev_cli_segurado: .api_build_i: &api_build_i
<<: *has_tag_autopop_dev_cli_segurado variables:
stage: deploy API_SPECS_DIR: srv/src/microcredito/adapters/web/src/main/java/microcredito/adapter/web/specs
tags: API_OUTPUT_DIR: ../../../../../../../../../../../../api_output
- autopop ADDITIONAL_PROPERTIES: npmName=@microcredito/client,npmRepository=https://nexus.dev.evologica.com.br/repository/npm-internal,supportsES6=true,typescriptThreePlus=true,legacyDiscriminatorBehavior=false
script: before_script:
- cd ~/services/autopopCliente/segurado - openapi-generator --version
- docker stop AutoPopClienteSegurado - json --version
- docker rm AutoPopClienteSegurado script:
- docker-compose up -d # Compila .yaml
- mkdir api_output
deploy_autopop_homolog_cli_corretor: - cd $API_SPECS_DIR
<<: *has_tag_autopop_homolog_cli_corretor - echo "npx openapi-generator generate -i microcredito.service.yaml -g typescript-fetch --additional-properties npmName=@microcredito/client,npmRepository=https://nexus.dev.evologica.com.br/repository/npm-internal -o $API_OUTPUT_DIR --model-name-suffix ApiModel"
stage: deploy - npx openapi-generator generate -i microcredito.service.yaml -g typescript-fetch --additional-properties npmName=@microcredito/client,npmRepository=https://nexus.dev.evologica.com.br/repository/npm-internal -o $API_OUTPUT_DIR --model-name-suffix ApiModel
tags: # Gera/Altera arquivos do pacote
- autopop - cd $API_OUTPUT_DIR
script: - ls
- cd ~/services/autopopHomolog/corretor/ - echo "init.author.name = admin" > .npmrc
- docker stop AutoPopCorretorHomolog - echo "init.author.email = suporte@evologica.com.br" >> .npmrc
- docker rm AutoPopCorretorHomolog - echo "email=suporte@evologica.com.br" >> .npmrc
- docker-compose up -d - echo "" >> .npmrc
- echo "always-auth=true" >> .npmrc
deploy_autopop_homolog_cli_banseg: - echo "_auth=YWRtaW46amo1OFBkMDI=" >> .npmrc
<<: *has_tag_autopop_homolog_cli_banseg - json -I -f package.json -e "this.files=['dist']"
stage: deploy # - json -I -f package.json -e "this.devDependencies={'typescript':'^3.8.3'}"
tags: # Corrige buggera da exportacao
- autopop - echo "import * as AgenteApiModels from './AgenteApi'" > src/apis/index.ts
script: - echo "import * as ClienteApiModels from './ClienteApi'" >> src/apis/index.ts
- cd ~/services/autopopHomolog/banseg - echo "" >> src/apis/index.ts
- docker stop AutoPopHomolog - echo "import { AgenteApi } from './AgenteApi'" >> src/apis/index.ts
- docker rm AutoPopHomolog - echo "export { AgenteApi, AgenteApiModels }" >> src/apis/index.ts
- docker-compose up -d - echo "" >> src/apis/index.ts
- echo "import { ClienteApi } from './ClienteApi'" >> src/apis/index.ts
deploy_autopop_homolog_cli_banescor: - echo "export { ClienteApi, ClienteApiModels }" >> src/apis/index.ts
<<: *has_tag_autopop_homolog_cli_banescor - echo "" >> src/apis/index.ts
stage: deploy - echo "export * from './DefaultApi'" >> src/apis/index.ts
tags: - echo "export * from './DominioApi'" >> src/apis/index.ts
- autopop - echo "export * from './AnonimoApi'" >> src/apis/index.ts
script: # Instala e publica novo pacote
- cd ~/services/autopopHomolog/banescor - npm i
- docker stop AutoPopBanescorHomolog - ls
- docker rm AutoPopBanescorHomolog - npm run build
- docker-compose up -d - ls
deploy_autopop_homolog_cli_segcor: # api_build_test:
<<: *has_tag_autopop_homolog_cli_segcor # <<: *api_build_i
stage: deploy # stage: fast_test
# tags:
# - android
# when: manual
# allow_failure: true
# artifacts:
# when: on_failure
# paths:
# - api_output
# expire_in: 2 hours
# except:
# - tags
api_build:
<<: *api_build_i
<<: *has_tag_api_internal
stage: build
tags: tags:
- autopop - android
script: artifacts:
- cd ~/services/autopopClienteHomolog/corretor when: always
- docker stop AutoPopClienteCorretorHomolog paths:
- docker rm AutoPopClienteCorretorHomolog - api_output
- docker-compose up -d expire_in: 4 hours
deploy_autopop_homolog_cli_segurado: api_publish:
<<: *has_tag_autopop_homolog_cli_segurado <<: *has_tag_api_internal
stage: deploy stage: deploy
tags: tags:
- autopop - android
dependencies:
- api_build
script: script:
- cd ~/services/autopopClienteHomolog/segurado - cd api_output
- docker stop AutoPopClienteSeguradoHomolog - npm publish
- docker rm AutoPopClienteSeguradoHomolog
- docker-compose up -d
#-----------------------------------------------------------------------------------# #################################################################################################
#---------------------------------------BADGE---------------------------------------# # BADGES #
#-----------------------------------------------------------------------------------# #################################################################################################
generate_badges: generate_badges:
stage: badge stage: badges
tags: tags:
- python_script - python_script
when: always
allow_failure: true
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: fetch
dependencies: # cache: {}
before_script:
- mkdir public
script: script:
- python build\generate_badges.py ${CURIO_VERSION} - python build\generate_badges.py
artifacts: artifacts:
name: pages
paths: paths:
- ./*.svg - ./public/*.svg
expire_in: 2 weeks expire_in: 2 weeks
only: only:
- master - develop
update_badges: pages:
<<: *build_and_distribute stage: badges
stage: badge
variables:
GIT_STRATEGY: none
script: script:
- echo "Gerando badges" - echo "hi"
after_script: artifacts:
- python ${BUILD_ENVIROMENT_DIR}\scriptsCI\reexecute_last_master_badge_job.py ${PROJECT_ID} ${PROJECT_TOKEN} name: pages
paths:
- public
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment