diff --git a/.gitlab-ci-files/common-prepare.yml b/.gitlab-ci-files/common-prepare.yml index 8edc3f0..31f797a 100644 --- a/.gitlab-ci-files/common-prepare.yml +++ b/.gitlab-ci-files/common-prepare.yml @@ -8,11 +8,22 @@ - 'which rsync || ( sudo apt-get update -y && sudo apt-get install rsync -y )' - 'which make || ( sudo apt-get update -y && sudo apt-get install make -y )' +.add_ssh_keys: &add_ssh_keys + # Add the SSH key (stored in the SSH_PRIVATE_KEY variable) to the agent. + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + +.verify_ssh_host_keys: &verify_ssh_host_keys + # Verify SSH host keys + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "${SSH_KNOWN_HOSTS}" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + .standard_job: tags: [kvm] before_script: - *ensure_docker - - *ensure_rsync .make_in_docker: extends: .standard_job @@ -20,3 +31,21 @@ - docker login -u ${DOCKER_REGISTRY_USER} -p ${DOCKER_REGISTRY_PASS} ${DOCKER_REGISTRY_HOST} - cd scripts/${CI_DISTRO_TARGET} - make ${MAKE_TARGET} + +.upload_pkg: + extends: .standard_job + before_script: + - *ensure_rsync + - *add_ssh_keys + - *verify_ssh_host_keys + script: + - docker login -u ${DOCKER_REGISTRY_USER} -p ${DOCKER_REGISTRY_PASS} ${DOCKER_REGISTRY_HOST} + - cd scripts/${CI_DISTRO_TARGET} + - make ${MAKE_TARGET} + - pwd + - cd out + - time rsync -avP -e "ssh -p ${PKG_HOST_SSH_PORT}" depot@${PKG_HOST}:files/pkgs/RHEL/8/pEpJNIAdapter/SHA256SUMS || true + - if sha256sum --ignore-missing --check SHA256SUMS ; then echo "Package already exists... Exiting..." && exit ; else true ; fi + - sha256sum ./*.rpm | tee --append SHA256SUMS + - cat ./SHA256SUMS + - time rsync -azvP -e "ssh -p ${PKG_HOST_SSH_PORT}" --rsync-path="mkdir -p /home/depot/files/pkgs/RHEL/8/pEpJNIAdapter && rsync" ./*.rpm SHA256SUMS depot@${PKG_HOST}:files/pkgs/RHEL/8/pEpJNIAdapter/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 756749a..eb80f5d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,8 @@ include: stages: - build + - packages + # Debian @@ -10,6 +12,7 @@ debian10:build: extends: .make_in_docker stage: build variables: + MAKE_TARGET: "build" CI_DISTRO_TARGET: "debian10" DEBIAN_FRONTEND: "noninteractive" rules: @@ -19,6 +22,7 @@ debian10:tagged-build: extends: .make_in_docker stage: build variables: + MAKE_TARGET: "build" CI_DISTRO_TARGET: "debian10" DEBIAN_FRONTEND: "noninteractive" TAGGED_BUILD: "true" @@ -29,8 +33,8 @@ debian10-java8:build: extends: .make_in_docker stage: build variables: - CI_DISTRO_TARGET: "debian10" MAKE_TARGET: "java8" + CI_DISTRO_TARGET: "debian10" DEBIAN_FRONTEND: "noninteractive" rules: - if: '$CI_COMMIT_TAG !~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' @@ -45,3 +49,46 @@ debian10-java8:tagged-build: TAGGED_BUILD: "true" rules: - if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' + +# CentOS + +centos8:build: + extends: .make_in_docker + stage: build + variables: + MAKE_TARGET: "build" + CI_DISTRO_TARGET: "centos8" + rules: + - if: '$CI_COMMIT_TAG !~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' + +centos8:tagged-build: + extends: .make_in_docker + stage: build + variables: + MAKE_TARGET: "build" + CI_DISTRO_TARGET: "centos8" + TAGGED_BUILD: "true" + rules: + - if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' + +centos8:rpm: + extends: .make_in_docker + stage: packages + needs: ["centos8:build"] + variables: + MAKE_TARGET: "rpm" + CI_DISTRO_TARGET: "centos8" + rules: + - if: '$CI_COMMIT_TAG !~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' + + +centos8:rpm:tagged-build: + extends: .upload_pkg + stage: packages + needs: ["centos8:tagged-build"] + variables: + MAKE_TARGET: "rpm" + CI_DISTRO_TARGET: "centos8" + TAGGED_BUILD: "true" + rules: + - if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/' diff --git a/DEPENDENCIES b/DEPENDENCIES index bbbee56..ccafdb8 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,5 +1,5 @@ # 1st Party Dependencies ## Prefer git tags instead of SHA hashes when possible. -libpEpAdapter=Release_2.1.21 -pEpEngine=Release_2.1.45 \ No newline at end of file +libpEpAdapter=Release_2.1.22 +pEpEngine=Release_2.1.49 \ No newline at end of file diff --git a/androidTests/app/src/main/java/com/pep/k9/MainActivity.java b/androidTests/app/src/main/java/com/pep/k9/MainActivity.java index 435a4f7..37fa1a3 100644 --- a/androidTests/app/src/main/java/com/pep/k9/MainActivity.java +++ b/androidTests/app/src/main/java/com/pep/k9/MainActivity.java @@ -260,7 +260,6 @@ public class MainActivity extends AppCompatActivity { @BindView(R.id.bRunTypes) Button runTypes; @BindView(R.id.bRunAliceBob) Button runIntegration; - @BindView(R.id.bRunServerLookup) Button runLookup; @BindView(R.id.bRunGenKey) Button runGenKey; @BindView(R.id.encrypt_and_decrypt) Button runEncryptAndDecrypt; @BindView(R.id.encrypt_and_decrypt_without_key) Button runEncryptAndDecryptWithoutKey; @@ -287,11 +286,6 @@ public class MainActivity extends AppCompatActivity { runIntegration.setText(TESTING); new RunTestTask().execute(6); } - @OnClick(R.id.bRunServerLookup) - public void runLookup() { - runLookup.setText(TESTING); - new RunTestTask().execute(2); - } @OnClick(R.id.bRunGenKey) public void runGenKey() { runGenKey.setText(TESTING); @@ -390,10 +384,6 @@ public class MainActivity extends AppCompatActivity { testPEpTypes(); } - private void runTestKeyserverLookup() throws pEpException, InterruptedException, IOException { - testKeyserverLookup(); - } - private void runTestKeyGen() throws pEpException, InterruptedException, IOException { testKeyGen(); } @@ -1494,46 +1484,6 @@ public class MainActivity extends AppCompatActivity { msg.setAttachments(attachments); } - /* - tests its possible to find the fingerprint on server - */ - public void testKeyserverLookup() throws pEpException, IOException, AssertionError, InterruptedException { - log("TEST: ", "Test keyserver lookup loaded"); - Engine e; - - e = new Engine(); - - long lastTime = System.currentTimeMillis(); - e.startKeyserverLookup(); - log("engine.startLookup", String.valueOf(System.currentTimeMillis() - lastTime)); - - Identity vb = new Identity(); - vb.username = "pEpDontAssert"; - vb.address = "vb@ulm.ccc.de"; - vb.user_id = "SsI6H9"; - updateIdentityOnEngine(e, vb); - - int count = 0; - while (count++ < 5000) { - Thread.sleep(1); - } - - String fpr = e.updateIdentity(vb).fpr; - - log("PEPTEST", "keyserver test fpr"); - log("PEPTEST", fpr != null ? fpr : "NULL"); - if (fpr == null) throw new AssertionError(); - - lastTime = System.currentTimeMillis(); - e.stopKeyserverLookup(); - log("engine.stopLookup", String.valueOf(System.currentTimeMillis() - lastTime)); - - lastTime = System.currentTimeMillis(); - e.close(); - log("engine.close", String.valueOf(System.currentTimeMillis() - lastTime)); - log("TEST: ", "Test keyserver lookup finished"); - } - /* tests I can get my own fingerprint */ @@ -1927,18 +1877,15 @@ public class MainActivity extends AppCompatActivity { runTestPEpTypes(); return 1; case 2: - runTestKeyserverLookup(); - return 2; - case 3: runEncryptAndDecryptTest(); return 3; - case 4: + case 3: runEncryptAndDecryptWithoutKeyTest(); return 4; - case 5: + case 4: runColorRatingsTest(); return 5; - case 6: + case 5: runIntegrationTest(); return 6; case 16: diff --git a/androidTests/app/src/main/res/layout/activity_main.xml b/androidTests/app/src/main/res/layout/activity_main.xml index 25726c4..344b55e 100644 --- a/androidTests/app/src/main/res/layout/activity_main.xml +++ b/androidTests/app/src/main/res/layout/activity_main.xml @@ -57,27 +57,6 @@ android:text="Run" /> - - - - -