feature/add-jenkinsfile (#114)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Co-authored-by: Michael Hönnig <michael@hoennig.de> Reviewed-on: #114 Reviewed-by: Timotheus Pokorra <timotheus.pokorra@hostsharing.net>
This commit is contained in:
parent
c26ae77a09
commit
c181500a1d
52
Jenkinsfile
vendored
Normal file
52
Jenkinsfile
vendored
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
10
etc/jenkinsAgent.Dockerfile
Normal file
10
etc/jenkinsAgent.Dockerfile
Normal 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"]
|
@ -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));
|
||||
}
|
||||
|
@ -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>();
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user