feature/add-jenkinsfile #114

Merged
hsh-michaelhoennig merged 5 commits from feature/add-jenkinsfile into master 2024-10-14 10:36:58 +02:00
5 changed files with 77 additions and 4 deletions

52
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,52 @@
pipeline {
agent {
dockerfile {
filename 'etc/jenkinsAgent.Dockerfile'
// additionalBuildArgs ...
args '--network=bridge --user root -v $PWD:$PWD -v /var/run/docker.sock:/var/run/docker.sock --group-add 984'
reuseNode true
}
}
environment {
DOCKER_HOST = 'unix:///var/run/docker.sock'
HSADMINNG_POSTGRES_ADMIN_USERNAME = 'admin'
HSADMINNG_POSTGRES_RESTRICTED_USERNAME = 'restricted'
HSADMINNG_MIGRATION_DATA_PATH = 'migration'
}
triggers {
pollSCM('H/1 * * * *')
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage ('Compile & Test') {
steps {
sh './gradlew clean check --no-daemon -x pitest -x dependencyCheckAnalyze'
}
}
}
post {
always {
// archive test results
junit 'build/test-results/test/*.xml'
// archive the JaCoCo coverage report in XML and HTML format
jacoco(
execPattern: 'build/jacoco/*.exec',
classPattern: 'build/classes/java/main',
sourcePattern: 'src/main/java'
)
// cleanup workspace
cleanWs()
}
}
}

View File

@ -0,0 +1,10 @@
FROM eclipse-temurin:21-jdk
RUN apt-get update && \
apt-get install -y bind9-utils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# RUN mkdir /opt/app
# COPY japp.jar /opt
# CMD ["java", "-jar", "/opt/app/japp.jar"]

View File

@ -28,10 +28,10 @@ public interface HsOfficeRelationRbacRepository extends Repository<HsOfficeRelat
* @return a list of (accessible) relations which match all given criteria
*/
default List<HsOfficeRelationRbacEntity> findRelationRelatedToPersonUuidRelationTypePersonAndContactData(
UUID personUuid,
HsOfficeRelationType relationType,
String personData,
String contactData) {
final UUID personUuid,
final HsOfficeRelationType relationType,
final String personData,
final String contactData) {
return findRelationRelatedToPersonUuidRelationTypePersonAndContactDataImpl(
personUuid, toStringOrNull(relationType), toSqlLikeOperand(personData), toSqlLikeOperand(contactData));
}

View File

@ -176,6 +176,7 @@ class HsDomainDnsSetupHostingAssetValidatorUnitTest {
// given
final var givenEntity = validEntityBuilder().build();
final var validator = HostingAssetEntityValidatorRegistry.forType(givenEntity.getType());
Dns.fakeResultForDomain(givenEntity.getIdentifier(), Dns.Result.fromRecords());
// when
final var errors = validator.validateContext(givenEntity);
@ -317,6 +318,7 @@ class HsDomainDnsSetupHostingAssetValidatorUnitTest {
))
.build();
final var validator = HostingAssetEntityValidatorRegistry.forType(givenEntity.getType());
Dns.fakeResultForDomain("example.org", Dns.Result.fromRecords());
// when
final var errors = validator.validateContext(givenEntity);
@ -340,6 +342,7 @@ class HsDomainDnsSetupHostingAssetValidatorUnitTest {
))
.build();
final var validator = HostingAssetEntityValidatorRegistry.forType(givenEntity.getType());
Dns.fakeResultForDomain("example.org", Dns.Result.fromRecords());
// when
final var zonefileErrors = new ArrayList<String>();

View File

@ -33,3 +33,11 @@ logging:
level:
liquibase: WARN
net.ttddyy.dsproxy.listener: DEBUG # HOWTO: log meaningful SQL statements
# just for the case there are problems with Testcontainers/Docker integration
# org.testcontainers: DEBUG
# com.github.dockerjava: DEBUG
testcontainers:
network:
mode: host