From b934e977a8949f966d0fb28cd785abc95c50954c Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Fri, 30 Oct 2020 09:51:14 +0100 Subject: Add CI pipeline --- .cisettings.xml | 16 ++++++++++++++ .gitlab-ci.yml | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 37 +++++++++++++++---------------- 3 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 .cisettings.xml create mode 100644 .gitlab-ci.yml diff --git a/.cisettings.xml b/.cisettings.xml new file mode 100644 index 00000000..61f6265f --- /dev/null +++ b/.cisettings.xml @@ -0,0 +1,16 @@ + + + + gitlab + + + + Job-Token + ${env.CI_JOB_TOKEN} + + + + + + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..2d0e2687 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,68 @@ +image: maven:latest + +variables: + LC_ALL: "en_US.UTF-8" + LANG: "en_US.UTF-8" + LANGUAGE: "en_US" + LIB_NAME: "eaaf-components" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings .cisettings.xml" + MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" + GIT_SUBMODULE_STRATEGY: recursive + GIT_DEPTH: "2" + SECURE_LOG_LEVEL: "debug" + +include: + - template: Dependency-Scanning.gitlab-ci.yml + - template: Security/SAST.gitlab-ci.yml + - template: Secret-Detection.gitlab-ci.yml + +stages: + - assemble + - test + - package + - release + +cache: + paths: + - ".m2/repository" + +assemble: + stage: assemble + except: + - tags + script: | + mvn $MAVEN_CLI_OPTS compile test + artifacts: + when: always + reports: + junit: "target/surefire-reports/TEST-*.xml" + +publishToGitlab: + stage: package + except: + - tags + script: | + export VERSION=$(mvn -B help:evaluate -Dexpression=project.version -B | grep -v "\[INFO\]" | grep -Po "\d+\.\d+\.\d+((-\w*)+)?") + echo "Publishing version $VERSION for $LIB_NAME" + mvnw $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy + echo "VERSION=$VERSION" >> variables.env + artifacts: + when: always + reports: + dotenv: variables.env + +release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + needs: + - job: publishToGitlab + artifacts: true + when: manual + only: + - master + script: | + echo "Releasing version $VERSION of $LIB_NAME" + release: + name: "$VERSION" + tag_name: "v$VERSION" + description: "$(cat README.md)" diff --git a/pom.xml b/pom.xml index 9dc9c733..b9ad9c9a 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ 2.13_moa 2.13_moa - 0.5.1 + 0.5.3-SNAPSHOT 1.30.2 @@ -99,24 +99,8 @@ - asit-snapshot - https://dev.a-sit.at/repositories/snapshot - - false - - - true - - - - asit-release - https://dev.a-sit.at/repositories/release - - true - - - false - + gitlab + https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven egiz-commons @@ -142,6 +126,19 @@ + + gitlabDeploy + + + gitlab + https://gitlab.iaik.tugraz.at/api/v4/projects/507/packages/maven + + + gitlab + https://gitlab.iaik.tugraz.at/api/v4/projects/507/packages/maven + + + jenkinsDeploy @@ -737,4 +734,4 @@ - \ No newline at end of file + -- cgit v1.2.3 From 4fff33e9d658ca458c31394767a92f5f6599a643 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Fri, 30 Oct 2020 10:45:38 +0100 Subject: CI: Fix typo --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d0e2687..4fbd5459 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: LANG: "en_US.UTF-8" LANGUAGE: "en_US" LIB_NAME: "eaaf-components" - MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings .cisettings.xml" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" GIT_SUBMODULE_STRATEGY: recursive GIT_DEPTH: "2" @@ -44,7 +44,7 @@ publishToGitlab: script: | export VERSION=$(mvn -B help:evaluate -Dexpression=project.version -B | grep -v "\[INFO\]" | grep -Po "\d+\.\d+\.\d+((-\w*)+)?") echo "Publishing version $VERSION for $LIB_NAME" - mvnw $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy + mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy echo "VERSION=$VERSION" >> variables.env artifacts: when: always -- cgit v1.2.3 From 475c30468cdfe502a48b735837b99d1fd2661132 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Fri, 30 Oct 2020 10:59:29 +0100 Subject: CI: Add junit report, enable code quality scanning --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fbd5459..516f0a75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,7 @@ include: - template: Dependency-Scanning.gitlab-ci.yml - template: Security/SAST.gitlab-ci.yml - template: Secret-Detection.gitlab-ci.yml + - template: Code-Quality.gitlab-ci.yml stages: - assemble @@ -35,7 +36,7 @@ assemble: artifacts: when: always reports: - junit: "target/surefire-reports/TEST-*.xml" + junit: "**/target/surefire-reports/TEST-*.xml" publishToGitlab: stage: package -- cgit v1.2.3 From 17bef2441719f3d36ee74fd526f03c86810653d6 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Fri, 30 Oct 2020 12:02:13 +0100 Subject: CI: Use cisettings for spotbugs --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 516f0a75..db89c941 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: LANG: "en_US.UTF-8" LANGUAGE: "en_US" LIB_NAME: "eaaf-components" - MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings ${CI_PROJECT_DIR}/.cisettings.xml" MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" GIT_SUBMODULE_STRATEGY: recursive GIT_DEPTH: "2" -- cgit v1.2.3 From 50d56b815d61e625cad5b0af6513e83a1dd43c75 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 4 Dec 2020 22:25:29 +0100 Subject: change url to maven repo of HSM-Facade-Provider --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9ad9c9a..206254a6 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ gitlab - https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven + https://gitlab.iaik.tugraz.at/api/v4/projects/585/packages/maven egiz-commons -- cgit v1.2.3 From 3cc7010e91d6b586f31e427ded18e03cb78f4e50 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 4 Dec 2020 22:34:13 +0100 Subject: Revert "change url to maven repo of HSM-Facade-Provider" This reverts commit 50d56b815d61e625cad5b0af6513e83a1dd43c75. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 206254a6..b9ad9c9a 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ gitlab - https://gitlab.iaik.tugraz.at/api/v4/projects/585/packages/maven + https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven egiz-commons -- cgit v1.2.3 From e86470c390c6592e86010be8eaa17804d6a82026 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 10:34:05 +0100 Subject: update grpc lib. to latest version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9ad9c9a..12d637f1 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 2.13_moa 0.5.3-SNAPSHOT - 1.30.2 + 1.34.0 5.2.8.RELEASE -- cgit v1.2.3 From d1712f8e88a76cd138593296f209ff4c2e1a166d Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 13:20:45 +0100 Subject: change gitlab authentication enable local gitlab runner --- .cisettings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cisettings.xml b/.cisettings.xml index 61f6265f..d6ed13dd 100644 --- a/.cisettings.xml +++ b/.cisettings.xml @@ -9,6 +9,10 @@ Job-Token ${env.CI_JOB_TOKEN} + + Private-Token + ${env.CI_JOB_TOKEN} + -- cgit v1.2.3 From 39838994aefae9921a5e64cd71a7f28f770c2561 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 14:03:02 +0100 Subject: update code-qualitiy plug-ins to support JDK 15 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 12d637f1..d9ceb292 100644 --- a/pom.xml +++ b/pom.xml @@ -86,11 +86,11 @@ 1.18.12 - 0.8.5 - 3.1.0 - 3.12.0 - 3.1.12.2 - 5.3.2 + 0.8.6 + 3.1.1 + 3.14.0 + 4.1.4 + 6.0.3 ${project.build.directory}/thirdparty_licenses https://apps.egiz.gv.at/checkstyle/egiz_pmd_checks.xml -- cgit v1.2.3 From fd7f5084f27e91e08fdbfbca15a282c03721b850 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 14:26:07 +0100 Subject: update jUnit tests to fix problem with execution order --- .../impl/logging/EaafUtilsMessageSourceTest.java | 6 +- ...tionPendingRequestIdGenerationStrategyTest.java | 2 + ...dingRequestIdGenerationStrategyWithHsmTest.java | 2 + .../test/credentials/EaafKeyStoreFactoryTest.java | 73 +++++++++++----------- .../eaaf/core/test/http/HttpClientFactoryTest.java | 1 + 5 files changed, 46 insertions(+), 38 deletions(-) diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java index 53ea54dc..125dcb09 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java @@ -2,19 +2,21 @@ package at.gv.egiz.eaaf.core.impl.logging; import java.util.List; -import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_not_lazy.beans.xml") +@DirtiesContext public class EaafUtilsMessageSourceTest { @Autowired diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java index 34f4a3b1..42e24c74 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest.java @@ -20,6 +20,7 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -33,6 +34,7 @@ import at.gv.egiz.eaaf.core.impl.utils.AuthenticatedEncryptionPendingRequestIdGe @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_not_lazy.beans.xml") +@DirtiesContext public class AuthenticatedEncryptionPendingRequestIdGenerationStrategyTest { @Autowired private EaafKeyStoreFactory keyStoreFactory; diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyWithHsmTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyWithHsmTest.java index 95a2b7a7..b588bb3a 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyWithHsmTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/utils/test/AuthenticatedEncryptionPendingRequestIdGenerationStrategyWithHsmTest.java @@ -4,6 +4,7 @@ import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -12,6 +13,7 @@ import at.gv.egiz.eaaf.core.impl.utils.AuthenticatedEncryptionPendingRequestIdGe @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_not_lazy_with_hsm.beans.xml") +@DirtiesContext public class AuthenticatedEncryptionPendingRequestIdGenerationStrategyWithHsmTest { @Autowired private AuthenticatedEncryptionPendingRequestIdGenerationStrategy pendingIdStrategy; diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java index c0bd6f20..6d1b63d7 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java @@ -19,6 +19,7 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.annotation.DirtiesContext.MethodMode; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -45,7 +46,7 @@ import io.grpc.StatusRuntimeException; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_lazy.beans.xml") -@DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) +@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD) public class EaafKeyStoreFactoryTest { private static final String HSM_FACASE_HOST = "eid.a-sit.at"; @@ -72,7 +73,7 @@ public class EaafKeyStoreFactoryTest { /** * jUnit test set-up. */ - @Before + @Before public void testSetup() { mapConfig.clearAllConfig(); Security.removeProvider(HsmFacadeProvider.getInstance().getName()); @@ -80,7 +81,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void startWithoutConfigHsmFacadeConfig() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -88,7 +89,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void buildyStoreWithOutConfig() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -106,7 +107,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void buildyStoreWithPkcs11() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -125,7 +126,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithoutConfig() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -144,7 +145,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithoutConfigSecond() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -163,7 +164,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithoutPassword() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -184,7 +185,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithoutPath() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -206,7 +207,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithoutType() throws EaafException { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -224,7 +225,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithWrongPath() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -247,7 +248,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreWithWrongPassword() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -270,7 +271,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreSuccessJks() throws EaafException { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -290,7 +291,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreAccessOperations() throws EaafException, KeyStoreException { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -359,7 +360,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void softwareKeyStoreSuccessPkcs12() throws EaafException { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -379,7 +380,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricSoftwareKeyWithOutConfig() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -399,7 +400,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricSoftwareKeyWithOutSalt() { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -420,7 +421,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricSoftwareKeyValid() throws EaafException { final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class); Assert.assertFalse("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized()); @@ -439,7 +440,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeNoHostConfig() { context.getBean(EaafKeyStoreFactory.class); @@ -447,7 +448,7 @@ public class EaafKeyStoreFactoryTest { @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeOnlyHostConfig() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -462,7 +463,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingPort() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -482,7 +483,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingUsername() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -501,7 +502,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingPassword() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -521,7 +522,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingTrustedCertificate() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -543,7 +544,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingTrustedCertificateFile() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -566,8 +567,8 @@ public class EaafKeyStoreFactoryTest { } } - @Test - @DirtiesContext + @Test + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeMissingWrongTrustedCertificate() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -591,7 +592,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeInitialized() { mapConfig.putConfigValue(EaafKeyStoreFactory.CONFIG_PROP_HSM_FACADE_HOST, RandomStringUtils.randomNumeric(10)); @@ -610,7 +611,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeAlreadLoaded() { HsmFacadeProvider provider = HsmFacadeProvider.getInstance(); Security.addProvider(provider); @@ -621,7 +622,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeKeyStoreNoKeyStoreName() { configureHsmFacade(); @@ -643,7 +644,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeKeyStoreSuccess() throws EaafException { configureHsmFacade(); @@ -671,7 +672,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricHsmFacadeKeyWithOutConfig() { configureHsmFacade(); @@ -693,7 +694,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricHsmFacadeKeyWithOutKeyAlias() { configureHsmFacade(); @@ -716,7 +717,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricHsmFacadeKeyWrongKeyAlias() { configureHsmFacade(); @@ -741,7 +742,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void symmetricHsmFacadeKeyValid() throws EaafException { configureHsmFacade(); @@ -762,7 +763,7 @@ public class EaafKeyStoreFactoryTest { } @Test - @DirtiesContext + @DirtiesContext(methodMode = MethodMode.BEFORE_METHOD) public void hsmFacadeKeyStoreSuccessASitTestFacade() throws EaafException, KeyStoreException { configureHsmFacade(); diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java index 433e6893..c88e05d5 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java @@ -42,6 +42,7 @@ import okhttp3.tls.HeldCertificate; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_not_lazy.beans.xml") +@DirtiesContext public class HttpClientFactoryTest { @Autowired private EaafKeyStoreFactory keyStoreFactory; -- cgit v1.2.3 From 5810b17708c6fe70f0174b067cc2e05f09dd8c35 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 14:32:25 +0100 Subject: gitlab ci test --- .cisettings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cisettings.xml b/.cisettings.xml index d6ed13dd..2e050b67 100644 --- a/.cisettings.xml +++ b/.cisettings.xml @@ -9,10 +9,10 @@ Job-Token ${env.CI_JOB_TOKEN} - + -- cgit v1.2.3 From 7fb88ece6dc3a94d5dc9961a222462d893eb0888 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 15:21:47 +0100 Subject: update some more third-party libs --- pom.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index d9ceb292..104d25db 100644 --- a/pom.xml +++ b/pom.xml @@ -50,31 +50,31 @@ 5.2.8.RELEASE 3.4.5 2.2.0 - 1.66 - 1.66 + 1.67 + 1.67 1.7.30 - 1.14 + 1.15 3.11 1.9 4.4 - 2.7 + 2.8.0 1.4 3.0.1 1.7 1.3.2 - 2.10.6 + 2.10.8 3.0.2 - 29.0-jre + 30.0-jre - 4.5.12 - 4.4.13 + 4.5.13 + 4.4.14 - 2.11.1 + 2.12.0 0.7.2 1.1.6 - 2.11.0 + 2.12.0 2.7.1 -- cgit v1.2.3 From 71ee7827780f15f5126f4d0cbe55ad38723fa67c Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 15:22:24 +0100 Subject: update build pipeline to test deployment to egiz public maven --- .cisettings.xml | 23 ++++++++++++++++++++--- .gitlab-ci.yml | 16 +++++++++++++--- pom.xml | 4 ++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.cisettings.xml b/.cisettings.xml index 2e050b67..8556c6a8 100644 --- a/.cisettings.xml +++ b/.cisettings.xml @@ -9,12 +9,29 @@ Job-Token ${env.CI_JOB_TOKEN} - + ${env.PRIVATE_TOKEN} + + + + egizMaven + ${env.EGIZ_MAVEN_USER} + ${env.EGIZ_MAVEN_PASSWORD} + + + no + + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db89c941..37ca635e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ stages: cache: paths: - ".m2/repository" - + assemble: stage: assemble except: @@ -42,10 +42,14 @@ publishToGitlab: stage: package except: - tags + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: | export VERSION=$(mvn -B help:evaluate -Dexpression=project.version -B | grep -v "\[INFO\]" | grep -Po "\d+\.\d+\.\d+((-\w*)+)?") - echo "Publishing version $VERSION for $LIB_NAME" - mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy + echo "Publishing version $VERSION for $LIB_NAME to public EGIZ maven" + mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P jenkinsDeploy -DskipTests echo "VERSION=$VERSION" >> variables.env artifacts: when: always @@ -61,8 +65,14 @@ release: when: manual only: - master + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: | echo "Releasing version $VERSION of $LIB_NAME" + echo "Publishing version $VERSION to public EGIZ maven" + mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P jenkinsDeploy release: name: "$VERSION" tag_name: "v$VERSION" diff --git a/pom.xml b/pom.xml index 104d25db..1889eb35 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,10 @@ gitlab https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven + + gitlab-localbuild + https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven + egiz-commons https://apps.egiz.gv.at/maven/ -- cgit v1.2.3 From 4e2417b8b5e59b9659900ad36ce7248810813aeb Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 9 Dec 2020 10:25:59 +0100 Subject: update commons-collection to latest version, because velocity does not use it --- eaaf_core/pom.xml | 8 ++++++-- pom.xml | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/eaaf_core/pom.xml b/eaaf_core/pom.xml index 23df59a9..2993110d 100644 --- a/eaaf_core/pom.xml +++ b/eaaf_core/pom.xml @@ -54,8 +54,8 @@ org.apache.commons commons-lang3 - - + + org.apache.commons commons-collections4 @@ -75,6 +75,10 @@ org.apache.velocity velocity + + commons-collections + commons-collections + jaxen jaxen diff --git a/pom.xml b/pom.xml index 1889eb35..f573518c 100644 --- a/pom.xml +++ b/pom.xml @@ -57,6 +57,7 @@ 1.15 3.11 1.9 + 3.2.2 4.4 2.8.0 1.4 @@ -354,6 +355,11 @@ javax.annotation javax.annotation-api ${javax.annotation-api} + + + commons-collections + commons-collections + ${org.apache.commons-collections} org.apache.commons -- cgit v1.2.3