Finish implementing functional Maven build system
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3acab18ff2
commit
bec705ea6c
63
.drone.yml
63
.drone.yml
@ -1,15 +1,67 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
type: docker
|
||||||
|
name: build
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
event:
|
||||||
load: yes
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# test if it compiles correctly
|
||||||
|
- name: build
|
||||||
|
image: maven:3-eclipse-temurin-16
|
||||||
|
commands:
|
||||||
|
- mvn verify --no-transfer-progress -DskipTests=true -Dmaven.javadoc.skip=true -B -V
|
||||||
|
|
||||||
|
# run unit tests
|
||||||
|
- name: test
|
||||||
|
image: maven:3-eclipse-temurin-16
|
||||||
|
commands:
|
||||||
|
- mvn test --no-transfer-progress -B -V
|
||||||
|
|
||||||
|
# run code analysis
|
||||||
|
- name: code-analysis
|
||||||
|
image: maven:3-eclipse-temurin-16
|
||||||
|
commands:
|
||||||
|
- mvn sonar:sonar --no-transfer-progress -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.host.url=$SONAR_INSTANCE_URL -Dsonar.login=$SONAR_LOGIN_KEY -B -V
|
||||||
|
environment:
|
||||||
|
SONAR_PROJECT_KEY:
|
||||||
|
from_secret: sonar_project_key
|
||||||
|
SONAR_INSTANCE_URL:
|
||||||
|
from_secret: sonar_instance_url
|
||||||
|
SONAR_LOGIN_KEY:
|
||||||
|
from_secret: sonar_login_key
|
||||||
|
|
||||||
|
# upload to maven repository
|
||||||
|
- name: maven-deploy
|
||||||
|
image: maven:3-eclipse-temurin-16
|
||||||
|
commands:
|
||||||
|
- mvn deploy --no-transfer-progress -DskipTests=true -Dmaven.javadoc.skip=true -B -V -gs settings.xml -Dmaven.repo.username=$MAVEN_REPO_USERNAME -Dmaven.repo.password=$MAVEN_REPO_PASSWORD
|
||||||
|
environment:
|
||||||
|
MAVEN_REPO_USERNAME:
|
||||||
|
from_secret: maven_repo_username
|
||||||
|
MAVEN_REPO_PASSWORD:
|
||||||
|
from_secret: maven_repo_password
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
target:
|
||||||
|
- production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# skip all previous steps because they were already ran in the "build" phase; we don't need to re-analyze the code.
|
||||||
|
|
||||||
|
# upload to maven repository
|
||||||
- name: maven-deploy
|
- name: maven-deploy
|
||||||
image: maven:3-eclipse-temurin-16
|
image: maven:3-eclipse-temurin-16
|
||||||
commands:
|
commands:
|
||||||
@ -19,8 +71,3 @@ steps:
|
|||||||
from_secret: maven_repo_username
|
from_secret: maven_repo_username
|
||||||
MAVEN_REPO_PASSWORD:
|
MAVEN_REPO_PASSWORD:
|
||||||
from_secret: maven_repo_password
|
from_secret: maven_repo_password
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- production
|
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>wtf.beatrice.hidekobot</groupId>
|
<groupId>wtf.beatrice.hidekobot</groupId>
|
||||||
<artifactId>HidekoBot</artifactId>
|
<artifactId>HidekoBot</artifactId>
|
||||||
<version>0.5.17</version>
|
<version>0.5.18-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>16</maven.compiler.source>
|
<maven.compiler.source>16</maven.compiler.source>
|
||||||
|
Loading…
Reference in New Issue
Block a user