Files
CloudflareDNS-java/.gitlab-ci.yml
T
thischwa 1ee3efa6c6 Update Sonar settings and SCM details in project config
Added `sonar.sourceEncoding` and updated Sonar Maven plugin to a specific version for improved compatibility. Adjusted SCM values to reflect the correct repository URLs under the `thischwa` namespace.
2025-04-22 07:16:03 +02:00

65 lines
1.4 KiB
YAML

default:
image: maven:3-amazoncorretto-17-alpine
stages:
- build
- on_commit
- sonarcloud_scan
variables:
GITLAB_CLONE_DIR: "/builds/thischwa/CloudflareDNS-java"
# GITLAB_CLONE_DIR: "cloudflaredns-java"
SONAR_HOST_URL: $SONAR_HOST_URL
SONAR_PROJECT_KEY: "thischwa_CloudflareDNS-java"
SONAR_ORGANIZATION: "thischwa"
SONAR_TOKEN: $SONAR_TOKEN
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
API_EMAIL: $API_EMAIL
API_KEY: $API_KEY
API_TOKEN: $API_TOKEN
build:
stage: build
script:
- echo "Running package..."
# - mkdir -p ${GITLAB_CLONE_DIR}
- cd ${GITLAB_CLONE_DIR}
- mvn clean package
artifacts:
paths:
- target/
on_commits:
stage: on_commit
dependencies:
- build
script:
- echo "on_commit DONE"
only:
- /^feature.*$/
- merge_request
- develop
sonarcloud_scan:
stage: sonarcloud_scan
dependencies:
- build
script:
- mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar:5.1.0.4751 \
-Dsonar.projectKey=thischwa_CloudflareDNS-java
only:
- merge_requests
- develop
pages:
stage: on_commit
script:
- echo "Deploying GitLab Pages from docs/"
- mkdir public
- cp -r docs/* public/
artifacts:
paths:
- public
only:
- develop