57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
image: eclipse-temurin:21-jdk
|
|
|
|
variables:
|
|
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
|
|
DEPLOY_DIR: "/home/gitlab-runner/deploy/marketing-parser"
|
|
PARSER_IMAGE_NAME: "marketing-parser-app"
|
|
PARSER_CONTAINER_NAME: "konturai-parser-app"
|
|
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .m2/repository
|
|
|
|
test:
|
|
stage: test
|
|
before_script:
|
|
- chmod +x mvnw
|
|
script:
|
|
- ./mvnw --batch-mode clean verify
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- target/site/jacoco/
|
|
reports:
|
|
junit:
|
|
- target/surefire-reports/TEST-*.xml
|
|
|
|
deploy_production:
|
|
stage: deploy
|
|
needs:
|
|
- test
|
|
tags:
|
|
- marketing-parser-prod
|
|
variables:
|
|
DOCKER_HOST: ""
|
|
DOCKER_TLS_VERIFY: ""
|
|
DOCKER_CERT_PATH: ""
|
|
DOCKER_TLS_CERTDIR: ""
|
|
COMPOSE_FILE: "$DEPLOY_DIR/deployment/docker-compose.server.yml"
|
|
COMPOSE_PROJECT_NAME: "marketing-parser"
|
|
rules:
|
|
- if: '$CI_PIPELINE_SOURCE == "push"'
|
|
- if: '$CI_PIPELINE_SOURCE == "web"'
|
|
before_script:
|
|
- command -v bash >/dev/null
|
|
- command -v docker >/dev/null
|
|
- command -v rsync >/dev/null
|
|
script:
|
|
- bash scripts/deploy_gitlab.sh
|
|
environment:
|
|
name: production
|
|
resource_group: marketing-parser-production
|