diff --git a/Jenkinsfile.cd b/Jenkinsfile.cd index 831cacd9d6..9ee1a51f90 100644 --- a/Jenkinsfile.cd +++ b/Jenkinsfile.cd @@ -19,7 +19,6 @@ Ubuntu18 = "Ubuntu 18.04" Centos = "Centos" libindyBuildFinished = [(Ubuntu16): false, (Ubuntu18): false, (Centos): false] -libvcxBuildFinished = [(Ubuntu16): false, (Ubuntu18): false, (Centos): false] ubuntuPakageTypes = [(Ubuntu16): "xenial", (Ubuntu18): "bionic"] gitHubUserCredId = env.GITHUB_BOT_USER ?: 'sovbot-github' @@ -115,7 +114,6 @@ def staticValidation() { parallel([ 'libindy' : { runValdiationRust('libindy') }, 'libnullpay': { runValdiationRust('libnullpay') }, - 'libvcx' : { runValdiationRust('vcx/libvcx') }, 'cli' : { runValdiationRust('cli') } ]) } @@ -125,12 +123,7 @@ def runValdiationRust(dir) { try { cleanWs() checkout scm - def testEnv - if (dir == 'vcx/libvcx') { - testEnv = dockerBuild("static-validation-libvcx", "vcx/ci/ubuntu.dockerfile .") - } else { - testEnv = dockerBuild("static-validation-libindy", "libindy/ci/ubuntu.dockerfile libindy/ci") - } + def testEnv = dockerBuild("static-validation-libindy", "libindy/ci/ubuntu.dockerfile libindy/ci") testEnv.inside { //FIXME waiting on IS-823 //sh "cargo clippy --manifest-path ${dir}/Cargo.toml" @@ -238,9 +231,6 @@ def linuxTesting(file, env_name, network_name) { def jobs = [ "${env_name}-cli-test": { linuxModuleTesting(file, env_name, network_name, this.&linuxCLITesting) - }, - "${env_name}-vcx-test": { - vcxTesting(file, env_name, network_name, full_testing) } ] if (full_testing) { @@ -262,38 +252,6 @@ def linuxTesting(file, env_name, network_name) { ]) } -def vcxTesting(file, env_name, network_name, full_testing) { - parallel([ - failFast : true, - "${env_name} Test: build and test libvcx" : { - node('ubuntu') { - cleanWs() - linuxVcxBuild(file, env_name, network_name) - } - }, - "${env_name} Test: test other vcx components": { - if (full_testing) { - waitUntil { - libvcxBuildFinished[env_name] - } - - def jobs = [ - "${env_name}-vcx-nodejs-test": { - linuxModuleTesting(file, env_name, network_name, this.&linuxVcxNodejsTesting) - }, - "${env_name}-vcx-java-test" : { - linuxModuleTesting(file, env_name, network_name, this.&linuxVcxJavaTesting) - }, - "${env_name}-vcx-python-test": { - linuxModuleTesting(file, env_name, network_name, this.&linuxVcxPythonTesting) - } - ] - parallel(jobs) - } - }, - ]) -} - def linuxLibindyBuild(file, env_name, network_name, full_testing) { def poolInst try { @@ -320,11 +278,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { sh "cp libindy/target/release/libindy.so wrappers/nodejs" sh "cp libindy/target/release/libindy.so cli" sh "cp libindy/target/release/libindy.so libnullpay" - sh "cp libindy/target/release/libindy.so vcx/libvcx" - sh "cp libindy/target/release/libindy.so vcx/wrappers/node" - sh "cp libindy/target/release/libindy.so vcx/wrappers/java" - sh "cp libindy/target/release/libindy.so vcx/wrappers/python3" - sh "cp libindy/target/release/libindy.so vcx/dummy-cloud-agent" testEnv.inside { echo "${env_name} Libnullpay Test: Build" @@ -338,10 +291,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { } sh "cp libnullpay/target/release/libnullpay.so cli" - sh "cp libnullpay/target/release/libnullpay.so vcx/libvcx" - sh "cp libnullpay/target/release/libnullpay.so vcx/wrappers/node" - sh "cp libnullpay/target/release/libnullpay.so vcx/wrappers/java" - sh "cp libnullpay/target/release/libnullpay.so vcx/wrappers/python3" stash includes: 'wrappers/java/lib/libindy.so', name: "LibindyJavaSO${env_name}" stash includes: 'wrappers/python/libindy.so', name: "LibindyPythonSO${env_name}" @@ -349,11 +298,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { stash includes: 'wrappers/nodejs/libindy.so', name: "LibindyNodejsSO${env_name}" stash includes: 'cli/libindy.so', name: "LibindyCliSO${env_name}" stash includes: 'cli/libnullpay.so', name: "LibnullpayCliSO${env_name}" - stash includes: 'vcx/libvcx/libindy.so,vcx/libvcx/libnullpay.so', name: "VCXLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/node/libindy.so,vcx/wrappers/node/libnullpay.so', name: "VcxNodeLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/java/libindy.so,vcx/wrappers/java/libnullpay.so', name: "VcxJavaLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/python3/libindy.so,vcx/wrappers/python3/libnullpay.so', name: "VcxPythonLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/dummy-cloud-agent/libindy.so', name: "LibindyCloudAgentSO${env_name}" libindyBuildFinished[env_name] = true @@ -398,76 +342,6 @@ def testLibindyComponent(directory) { """ } -def linuxVcxBuild(file, env_name, network_name) { - def poolInst - try { - echo "${env_name} Test: Checkout csm" - checkout scm - - poolInst = openPool(env_name, network_name) - - def testEnv = buildTestEnv(file, env_name) - - unstash name: "VCXLibindyAndLibnullpaySO${env_name}" - - echo "${env_name} Libvcx Test: Build" - testEnv.inside { - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ cargo build --release --features fatal_warnings - ''' - - stash includes: 'vcx/libvcx/target/release/libvcx.so', name: "LibvcxBuildResult${env_name}" - - } - - sh "cp vcx/libvcx/target/release/libvcx.so vcx/wrappers/node" - sh "cp vcx/libvcx/target/release/libvcx.so vcx/wrappers/java" - sh "cp vcx/libvcx/target/release/libvcx.so vcx/wrappers/python3" - - stash includes: 'vcx/wrappers/node/libvcx.so', name: "VcxNodeLibvcxSO${env_name}" - stash includes: 'vcx/wrappers/java/libvcx.so', name: "VcxJavaLibvcxSO${env_name}" - stash includes: 'vcx/wrappers/python3/libvcx.so', name: "VcxPythonLibvcxSO${env_name}" - - libvcxBuildFinished[env_name] = true - - sh "cp vcx/libvcx/libindy.so vcx/dummy-cloud-agent" - - testEnv.inside("--network=${network_name}") { - sh ''' - cd vcx/dummy-cloud-agent - sed -i 's/\\("protocol_type": "\\)2.0/\\11.0/' config/sample-config.json - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy=info cargo run config/sample-config.json & - ''' - - echo "${env_name} Libvcx Test: Run tests" - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release --features "pool_tests agency" - ''' - } - - testEnv.inside("--network=${network_name}") { - sh ''' - cd vcx/dummy-cloud-agent - sed -i 's/\\("protocol_type": "\\)1.0/\\12.0/' config/sample-config.json - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy=info cargo run config/sample-config.json & - ''' - - echo "${env_name} Libvcx Test: Run vcx demo test for protocol version 2.0" - // TODO in Rust 1.39.0 there was a problem with test name before "--". Temporary put test name after it. - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release --features "pool_tests agency_v2" -- tests::test_real_proof_for_protocol_type_v2 --exact - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release --features "pool_tests aries" -- v3::test::aries_demo --exact - ''' - } - } - finally { - closePool(env_name, network_name, poolInst) - } -} - def linuxJavaTesting(env_name, network_name, testEnv) { unstash name: "LibindyJavaSO${env_name}" dir('wrappers/java') { @@ -539,50 +413,6 @@ def linuxNodejsTesting(env_name, network_name, testEnv) { } } -def linuxVcxNodejsTesting(env_name, network_name, testEnv) { - unstash name: "VcxNodeLibvcxSO${env_name}" - unstash name: "VcxNodeLibindyAndLibnullpaySO${env_name}" - - testEnv.inside("--network=${network_name}") { - echo "${env_name} Vcx Test: Test nodejs wrapper" - sh ''' - cd vcx/wrappers/node/ - npm i - npm run compile - LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} LIBVCX_PATH=./ npm test - ''' - } -} - -def linuxVcxJavaTesting(env_name, network_name, testEnv) { - unstash name: "VcxJavaLibvcxSO${env_name}" - unstash name: "VcxJavaLibindyAndLibnullpaySO${env_name}" - - dir('vcx/wrappers/java') { - echo "${env_name} Vcx Test: Test java wrapper" - - testEnv.inside("--network=${network_name}") { - sh 'LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} ./gradlew --no-daemon test' - } - } -} - -def linuxVcxPythonTesting(env_name, network_name, testEnv) { - unstash name: "VcxPythonLibvcxSO${env_name}" - unstash name: "VcxPythonLibindyAndLibnullpaySO${env_name}" - - dir('vcx/wrappers/python3') { - testEnv.inside { - echo "${env_name} Vcx Test: Test python wrapper" - - sh ''' - python3 -m pip install --user pytest==3.6.4 pytest-asyncio==0.10.0 - LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} python3 -m pytest -s - ''' - } - } -} - def windowsTesting() { node('win2016') { stage('Windows Test') { @@ -682,36 +512,6 @@ def windowsTesting() { stash includes: 'target/release/indy-cli.exe,target/release/*.dll', name: 'IndyCliWindowsBuildResult' } - - bat "PowerShell.exe \"Copy-Item $WORKSPACE/libnullpay/target/release/nullpay.dll -Destination $WORKSPACE/vcx/libvcx\"" - - dir('vcx/libvcx') { - echo "Windows Libvcx Test: Build" - - // FIXME remove that once https://jira.hyperledger.org/browse/IS-1127 is resolved - bat """ - PowerShell.exe "&{(Get-Content -Path src/settings.rs -Raw) -replace '/tmp/test_init.json','./test_init.json'} | Set-Content -Path src/settings.rs" - """ - - withEnv([ - "OPENSSL_DIR=$WORKSPACE\\libindy\\prebuilt", - "RUST_BACKTRACE=1" - ]) { - bat "cargo build --release --features fatal_warnings" - bat "cargo test --release --no-run" - - echo "Windows Libvcx Test: Run tests" - withEnv([ - "RUST_TEST_THREADS=1", - "RUST_LOG=vcx=debug,indy::=debug", - "PATH=$WORKSPACE\\libindy\\target\\release;$PATH", - ]) { - bat "cargo test --release" - } - } - - stash includes: 'target/release/*.dll,target/release/*.dll.lib', name: 'LibvcxWindowsBuildResult' - } } finally { try { bat "docker -H $INDY_SDK_SERVER_IP stop indy_pool" @@ -898,19 +698,12 @@ def macosTesting() { stash includes: 'libindy/target/release/libindy.dylib,libindy/target/release/libindy.a', name: 'LibindyMacosBuildResult' sh "cp libindy/target/release/libindy.dylib libnullpay" - sh "cp libindy/target/release/libindy.dylib vcx/libvcx" sh "cp libindy/target/release/libindy.dylib cli" macosModuleBuildingAndTest('libnullpay') stash includes: 'libnullpay/target/release/libnullpay.dylib,libnullpay/target/release/libnullpay.a', name: 'LibnullpayMacosBuildResult' - sh "cp libnullpay/target/release/libnullpay.dylib vcx/libvcx" - - macosModuleBuildingAndTest('vcx/libvcx') - - stash includes: 'vcx/libvcx/target/release/libvcx.dylib,vcx/libvcx/target/release/libvcx.a', name: 'LibvcxMacosBuildResult' - sh "sed -i'.original' -e 's/10.0.0.2/127.0.0.1/g' cli/docker_pool_transactions_genesis" macosModuleBuildingAndTest('cli') @@ -971,7 +764,6 @@ def centosPublishing() { libindyRpmPublishing(testEnv, libindyVersion, env_name) libnullpayRpmPublishing(testEnv, env_name) - libvcxRpmPublishing(testEnv, env_name) indyCliRpmPublishing(testEnv, env_name) } finally { @@ -996,13 +788,6 @@ def libnullpayRpmPublishing(testEnv, env_name) { rpmPublishing(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "LibnullpayBuildResult${env_name}") } -def libvcxRpmPublishing(testEnv, env_name) { - echo 'Publish Libvcx rpm files' - def libvcxVersion = getSrcVersion("vcx/libvcx") - - rpmPublishing(testEnv, "vcx/libvcx", "libvcx", libvcxVersion, "LibvcxBuildResult${env_name}") -} - def indyCliRpmPublishing(testEnv, env_name) { echo 'Publish Indy Cli rpm files' def indyCliVersion = getSrcVersion("cli") @@ -1049,7 +834,6 @@ def linuxPublishing(file, env_name, build_wrappers) { libindyDebPublishing(testEnv, libindyVersion, env_name) libindyDevDebPublishing(testEnv, libindyVersion, env_name) libnullpayDebPublishing(testEnv, env_name) - libvcxDebPublishing(testEnv, env_name) libindyCliDebPublishing(testEnv, libindyVersion, env_name) // Note that last deb publishing should pass resetCache = true inside if (build_wrappers) { @@ -1057,9 +841,6 @@ def linuxPublishing(file, env_name, build_wrappers) { nodejsWrapperPublishing(testEnv, false, 'libindy') javaWrapperPublishing(testEnv, false) rustWrapperPublishing(testEnv, false) - vcxJavaWrapperPublishing(testEnv, false) - pythonWrapperPublishing(testEnv, false, 'vcx/wrappers/python3', 'vcx/libvcx') - nodejsWrapperPublishing(testEnv, false, 'vcx') } } @@ -1136,11 +917,6 @@ def windowsPublishing() { echo 'Publish Libnullpay Windows files' def libnullpayVersion = getSrcVersion("libnullpay") windowsPublishArtifact(testEnv, "libnullpay", "libnullpay", "lib", libnullpayVersion, "LibnullpayWindowsBuildResult") - - echo 'Publish Libvcx Windows files' - def libvcxVersion = getSrcVersion("vcx/libvcx") - windowsPublishArtifact(testEnv, "vcx/libvcx", "libvcx", "lib", libvcxVersion, "LibvcxWindowsBuildResult") - } finally { echo 'Publish Windows files: Cleanup' @@ -1239,10 +1015,6 @@ def macOsPublishing() { def libnullpayVersion = getSrcVersion("libnullpay") publishMacOsArtifact(testEnv, "libnullpay", "libnullpay", "LibnullpayMacosBuildResult", libnullpayVersion, "lib") - echo 'Publish Libvcx MacOS Library' - def libvcxVersion = getSrcVersion("vcx/libvcx") - publishMacOsArtifact(testEnv, "libvcx", "vcx/libvcx", "LibvcxMacosBuildResult", libvcxVersion, "lib") - echo 'Publish Indy CLI MacOS Library' def cliVersion = getSrcVersion("cli") publishMacOsArtifact(testEnv, "indy-cli", "cli", "IndyCliMacosBuildResult", cliVersion, "executable") @@ -1319,16 +1091,6 @@ def libnullpayDebPublishing(testEnv, env_name) { debPublishing(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "LibnullpayBuildResult${env_name}", "libnullpayDebs${env_name}", env_name) } -def libvcxDebPublishing(testEnv, env_name) { - echo 'Publish Libvcx deb files to Apt' - - def libvcxVersion = getSrcVersion("vcx/libvcx") - - setLibindyDependencyVersion("vcx/libvcx/Cargo.toml") - - debPublishing(testEnv, "vcx/libvcx", "libvcx", libvcxVersion, "LibvcxBuildResult${env_name}", "libvcxDebs${env_name}", env_name) -} - def setLibindyDependencyVersion(file) { def libindyVersion = getSrcVersion("libindy") def replaceVersion = "$libindyVersion~$env.BUILD_NUMBER" @@ -1382,8 +1144,7 @@ def pythonWrapperPublishing(testEnv, isRelease, directory, base_library) { } def nodejsWrapperPublishing(testEnv, isRelease, library) { - def paths = ['libindy': ['dir': 'wrappers/nodejs', 'base_library': 'libindy'], - 'vcx' : ['dir': 'vcx/wrappers/node', 'base_library': 'vcx/libvcx']] + def paths = ['libindy': ['dir': 'wrappers/nodejs', 'base_library': 'libindy']] def version = getSrcVersion(paths[library]['base_library']) @@ -1392,10 +1153,6 @@ def nodejsWrapperPublishing(testEnv, isRelease, library) { def directory = paths[library]['dir'] testEnv.inside { - if (library == 'vcx') { // need addition step for VCX to create .js files - sh "cd $directory && npm i && npm run compile" - } - npmPublish(version, suffix, directory) } } @@ -1432,31 +1189,6 @@ def javaWrapperPublishing(testEnv, isRelease) { } } -def vcxJavaWrapperPublishing(testEnv, isRelease) { - dir('vcx/wrappers/java') { - echo "Publish To Maven Test: Build docker image" - def version = getSrcVersion("vcx/libvcx") - def suffix = getSuffix(isRelease, "Maven") - - testEnv.inside { - echo "Publish To Maven Test: Test" - withCredentials([file(credentialsId: 'maven-settings', variable: 'settingsFile')]) { - sh 'cp $settingsFile .' - - sh "ci/buildJar.sh ${version}${suffix}" - - sh "chmod +x ci/publishJar.sh" - - withEnv([ - "MAVEN_ADD_OPTIONS=$mavenDeployAddOptions", - ]) { - sh 'ci/publishJar.sh' - } - } - } - } -} - def publishingRCtoStable() { node('ubuntu') { cleanWs() @@ -1472,7 +1204,6 @@ def publishingRCtoStable() { def libindyVersion = getSrcVersion("libindy") def libnullpayVersion = getSrcVersion("libnullpay") - def libvcxVersion = getSrcVersion("vcx/libvcx") def env_name = Ubuntu16 @@ -1510,30 +1241,12 @@ def publishingRCtoStable() { echo "Moving ${env_name} RC artifacts to Stable: libnullpay" publishLibnullpayDebRCtoStable(testEnv, env_name) - echo 'Moving Windows RC artifacts to Stable: libvcx' - publishLibVCXWindowsFilesRCtoStable(libvcxVersion) - - echo "Moving ${env_name} RC artifacts to Stable: libvcx" - publishLibvcxDebRCtoStable(testEnv, env_name) // Note that last deb publishing should pass resetCache = true inside - - echo 'Moving Ubuntu RC artifacts to Stable: vcx java wrapper' - vcxJavaWrapperPublishing(testEnv, true) - - echo 'Moving Ubuntu RC artifacts to Stable: vcx python wrapper' - pythonWrapperPublishing(testEnv, true, 'vcx/wrappers/python3', 'vcx/libvcx') - - echo 'Moving Ubuntu RC artifacts to Stable: vcx nodejs wrapper' - nodejsWrapperPublishing(testEnv, true, 'vcx') - echo 'Moving Android RC artifacts to Stable: libindy' publishLibindAndroidFilesRCtoStable(libindyVersion) echo 'Moving Android RC artifacts to Stable: libnullpay' publishLibnullpayAndroidFilesRCtoStable() - echo 'Moving Android RC artifacts to Stable: libvcx' - publishLibvcxAndroidFilesRCtoStable() - echo 'Moving iOS RC artifacts to Stable: libindy' publishLibindyIOSFilesRCtoStable(libindyVersion) @@ -1546,9 +1259,6 @@ def publishingRCtoStable() { echo 'Moving MacOS RC artifacts to Stable: libnullpay' publishLibnullpayMacOSFilesRCtoStable(libnullpayVersion) - echo 'Moving MacOS RC artifacts to Stable: libvcx' - publishLibvcxMacOSFilesRCtoStable(libvcxVersion) - echo 'Moving MacOS RC artifacts to Stable: indy cli' publishIndyCliMacOSFilesRCtoStable(libindyVersion) @@ -1566,9 +1276,6 @@ def publishingRCtoStable() { echo "Moving ${env_name} RC artifacts to Stable: libnullpay" publishLibnullpayDebRCtoStable(ubuntu18Env, env_name) - echo "Moving ${env_name} RC artifacts to Stable: libvcx" - publishLibvcxDebRCtoStable(ubuntu18Env, env_name) - env_name = Centos echo "Moving ${env_name} RC artifacts to Stable: libindy" @@ -1577,9 +1284,6 @@ def publishingRCtoStable() { echo "Moving ${env_name} RC artifacts to Stable: libnullpay" publishLibnullpayCentosFilesRCtoStable(libnullpayVersion) - echo "Moving ${env_name} RC artifacts to Stable: libvcx" - publishLibvcxCentosFilesRCtoStable(libvcxVersion) - echo "Moving ${env_name} RC artifacts to Stable: indy-cli" publishIndyCliCentosFilesRCtoStable(libindyVersion) @@ -1599,10 +1303,6 @@ def publishLibnullpayCentosFilesRCtoStable(version) { publishCentosFilesRCtoStable("libnullpay", version) } -def publishLibvcxCentosFilesRCtoStable(version) { - publishCentosFilesRCtoStable("libvcx", version) -} - def publishIndyCliCentosFilesRCtoStable(version) { publishCentosFilesRCtoStable("indy-cli", version) } @@ -1623,10 +1323,6 @@ def publishLibnullpayWindowsFilesRCtoStable(libnullpayVersion) { publishWindowsFilesRCtoStable("libnullpay", libnullpayVersion) } -def publishLibVCXWindowsFilesRCtoStable(libvcxVersion) { - publishWindowsFilesRCtoStable("libvcx", libvcxVersion) -} - def publishLibindAndroidFilesRCtoStable(version) { publishAndroidFilesRCtoStable("libindy", version) } @@ -1636,11 +1332,6 @@ def publishLibnullpayAndroidFilesRCtoStable() { publishAndroidFilesRCtoStable("libnullpay", libnullpayVersion) } -def publishLibvcxAndroidFilesRCtoStable() { - def libvcxVersion = getSrcVersion("vcx/libvcx") - publishAndroidFilesRCtoStable("libvcx", libvcxVersion) -} - def publishAndroidFilesRCtoStable(packageName, version) { copyRcFilesToStable("android", packageName, version) } @@ -1688,10 +1379,6 @@ def publishLibnullpayMacOSFilesRCtoStable(version) { publishMacosFilesRCtoStable("libnullpay", version) } -def publishLibvcxMacOSFilesRCtoStable(version) { - publishMacosFilesRCtoStable("libvcx", version) -} - def publishIndyCliMacOSFilesRCtoStable(version) { publishMacosFilesRCtoStable("indy-cli", version) } @@ -1724,11 +1411,6 @@ def publishLibnullpayDebRCtoStable(testEnv, env_name) { publishDebRCtoStable(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "libnullpayDebs", env_name) } -def publishLibvcxDebRCtoStable(testEnv, env_name) { - def libvcxVersion = getSrcVersion("vcx/libvcx") - publishDebRCtoStable(testEnv, "libvcx", "vcx/libvcx", libvcxVersion, "libvcxDebs", env_name, true) -} - def publishDebRCtoStable(testEnv, packageName, directory, version, stashName, env_name, resetCache = false) { testEnv.inside { sh "mkdir -p $directory/sovrin-packaging/" @@ -1790,7 +1472,6 @@ def androidPublishing() { libindyVersion = getSrcVersion("libindy") libnullpayVersion = getSrcVersion("libnullpay") - libvcxVersion = getSrcVersion("vcx/libvcx") echo 'Publish Android binaries: Building docker image' @@ -1798,7 +1479,6 @@ def androidPublishing() { publishAndroid(buildEnv, libindyVersion, 'libindy') publishAndroid(buildEnv, libnullpayVersion, 'libnullpay') - publishAndroid(buildEnv, libvcxVersion, 'libvcx') } finally { @@ -1846,16 +1526,6 @@ def androidBuildArtifact(buildEnv, arch, libVersion, artifact, libIndyVersion) { sh "cp libnullpay/${libnullpay_zip_name} ./" stash includes: "${libnullpay_zip_name}", name: "libnullpay_${arch}_zip" } - } else if (artifactName == "LIBVCX") { - buildEnv.inside { - unstash name: "libindy_${arch}_zip" - sh "cp libindy_android_${arch}_${libIndyVersion}.zip vcx/libvcx && unzip -o vcx/libvcx/libindy_android_${arch}_${libIndyVersion}.zip " - stash includes: "libindy_android_${arch}_${libIndyVersion}.zip", name: "libindy_${arch}_zip" - sh "cd vcx/libvcx && ${artifactName}_VERSION=${libVersion} LIBINDY_DIR=../../libindy_${arch}/lib INDY_DIR=../../libindy_${arch}/lib ./${ANDROID_SCRIPT_PATH} -d $arch" - def libvcx_zip_name = "libvcx_android_${arch}_${libVersion}.zip" - sh "cp vcx/libvcx/${libvcx_zip_name} ./" - stash includes: "${libvcx_zip_name}", name: "libvcx_${arch}_zip" - } } } @@ -1920,18 +1590,15 @@ def androidBuildAsTesting() { def libindyVersion = getSrcVersion("libindy") def libnullpayVersion = getSrcVersion("libnullpay") - def libvcxVersion = getSrcVersion("vcx/libvcx") echo 'Building android binaries: Building docker image' dockerBuild('libindy', 'libindy/ci/ubuntu.dockerfile libindy/ci') def buildEnv = dockerBuild('indy-sdk', 'libindy/ci/android.dockerfile libindy/ci') - def vcxBuildEnv = dockerBuild('indy-sdk', 'libindy/ci/android.dockerfile libindy/ci') sh 'chmod -R 777 libindy/' sh 'chmod -R 777 libindy/ci/' buildAndroid(buildEnv, libindyVersion, 'libindy') buildAndroid(buildEnv, libnullpayVersion, 'libnullpay') - buildAndroid(vcxBuildEnv, libvcxVersion, 'libvcx', libindyVersion) } finally { echo 'Building Android binaries: Cleanup' diff --git a/Jenkinsfile.ci b/Jenkinsfile.ci index 807e57e8d2..b369642de4 100644 --- a/Jenkinsfile.ci +++ b/Jenkinsfile.ci @@ -6,7 +6,6 @@ Ubuntu18 = "Ubuntu 18.04" RedHat = "RedHat" libindyBuildFinished = [(Ubuntu16): false, (Ubuntu18): false, (RedHat): false] -libvcxBuildFinished = [(Ubuntu16): false, (Ubuntu18): false, (RedHat): false] testing() @@ -30,7 +29,6 @@ def staticValidation() { parallel([ 'libindy' : { runValdiationRust('libindy') }, 'libnullpay': { runValdiationRust('libnullpay') }, - 'libvcx' : { runValdiationRust('vcx/libvcx') }, 'cli' : { runValdiationRust('cli') } ]) } @@ -40,12 +38,7 @@ def runValdiationRust(dir) { try { cleanWs() checkout scm - def testEnv - if (dir == 'vcx/libvcx') { - testEnv = dockerBuild("static-validation-libvcx", "vcx/ci/ubuntu.dockerfile .") - } else { - testEnv = dockerBuild("static-validation-libindy", "libindy/ci/ubuntu.dockerfile libindy/ci") - } + def testEnv = dockerBuild("static-validation-libindy", "libindy/ci/ubuntu.dockerfile libindy/ci") testEnv.inside { //FIXME waiting on IS-823 //sh "cargo clippy --manifest-path ${dir}/Cargo.toml" @@ -157,29 +150,6 @@ def windowsTesting() { } } - bat "PowerShell.exe \"Copy-Item $WORKSPACE/libnullpay/target/debug/nullpay.dll -Destination $WORKSPACE/vcx/libvcx\"" - - dir('vcx/libvcx') { - echo "Windows Libvcx Test: Build" - - withEnv([ - "OPENSSL_DIR=$WORKSPACE\\libindy\\prebuilt", - "RUST_BACKTRACE=1" - ]) { - bat "cargo build --features fatal_warnings" - bat "cargo test --no-run" - - echo "Windows Libvcx Test: Run tests" - withEnv([ - "RUST_TEST_THREADS=1", - "RUST_LOG=vcx=debug,indy::=debug", - "PATH=$WORKSPACE\\libindy\\target\\debug;$PATH", - ]) { - bat "cargo test" - } - } - } - //TODO wrappers testing } finally { @@ -223,15 +193,10 @@ def macosTesting() { macosModuleBuildingAndTest('libindy', "--features only_high_cases") sh "cp libindy/target/debug/libindy.dylib libnullpay" - sh "cp libindy/target/debug/libindy.dylib vcx/libvcx" sh "cp libindy/target/debug/libindy.dylib cli" macosModuleBuildingAndTest('libnullpay') - sh "cp libnullpay/target/debug/libnullpay.dylib vcx/libvcx" - - macosModuleBuildingAndTest('vcx/libvcx') - sh "sed -i'.original' -e 's/10.0.0.2/127.0.0.1/g' cli/docker_pool_transactions_genesis" macosModuleBuildingAndTest('cli') @@ -391,44 +356,18 @@ def linuxTesting(file, env_name, network_name, full_testing) { def jobs = [ "${env_name}-cli-test": { linuxModuleTesting(file, env_name, network_name, this.&linuxCLITesting) - }, - "${env_name}-vcx-test": { - vcxTesting(file, env_name, network_name, full_testing) } ] if (full_testing) { jobs["${env_name}wrappers-test"] = { linuxModuleTesting(file, env_name, network_name, this.&linuxIndyWrappersTesting) } - jobs["${env_name}-cloud-agent-test"] = { - linuxModuleTesting(file, env_name, network_name, this.&linuxCloudAgentTesting) - } } parallel(jobs) }, ]) } -def vcxTesting(file, env_name, network_name, full_testing) { - parallel([ - failFast : true, - "${env_name} Test: build and test libvcx" : { - node('ubuntu') { - cleanWs() - linuxVcxBuild(file, env_name, network_name) - } - }, - "${env_name} Test: test other vcx components": { - if (full_testing) { - waitUntil { - libvcxBuildFinished[env_name] - } - linuxModuleTesting(file, env_name, network_name, this.&linuxVcxWrappersTesting) - } - }, - ]) -} - def linuxLibindyBuild(file, env_name, network_name, full_testing) { def poolInst try { @@ -453,11 +392,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { sh "cp libindy/target/debug/libindy.so wrappers/rust" sh "cp libindy/target/debug/libindy.so cli" sh "cp libindy/target/debug/libindy.so libnullpay" - sh "cp libindy/target/debug/libindy.so vcx/libvcx" - sh "cp libindy/target/debug/libindy.so vcx/wrappers/node" - sh "cp libindy/target/debug/libindy.so vcx/wrappers/java" - sh "cp libindy/target/debug/libindy.so vcx/wrappers/python3" - sh "cp libindy/target/debug/libindy.so vcx/dummy-cloud-agent" testEnv.inside { echo "${env_name} Libnullpay Test: Build" @@ -468,10 +402,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { } sh "cp libnullpay/target/debug/libnullpay.so cli" - sh "cp libnullpay/target/debug/libnullpay.so vcx/libvcx" - sh "cp libnullpay/target/debug/libnullpay.so vcx/wrappers/node" - sh "cp libnullpay/target/debug/libnullpay.so vcx/wrappers/java" - sh "cp libnullpay/target/debug/libnullpay.so vcx/wrappers/python3" stash includes: 'wrappers/java/lib/libindy.so', name: "LibindyJavaSO${env_name}" stash includes: 'wrappers/python/libindy.so', name: "LibindyPythonSO${env_name}" @@ -479,11 +409,6 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { stash includes: 'wrappers/rust/libindy.so', name: "LibindyRustSO${env_name}" stash includes: 'cli/libindy.so', name: "LibindyCliSO${env_name}" stash includes: 'cli/libnullpay.so', name: "LibnullpayCliSO${env_name}" - stash includes: 'vcx/libvcx/libindy.so,vcx/libvcx/libnullpay.so', name: "VCXLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/node/libindy.so,vcx/wrappers/node/libnullpay.so', name: "VcxNodeLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/java/libindy.so,vcx/wrappers/java/libnullpay.so', name: "VcxJavaLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/wrappers/python3/libindy.so,vcx/wrappers/python3/libnullpay.so', name: "VcxPythonLibindyAndLibnullpaySO${env_name}" - stash includes: 'vcx/dummy-cloud-agent/libindy.so', name: "LibindyCloudAgentSO${env_name}" libindyBuildFinished[env_name] = true @@ -528,74 +453,6 @@ def testLibindyComponent(directory) { """ } -def linuxVcxBuild(file, env_name, network_name) { - def poolInst - try { - echo "${env_name} Test: Checkout csm" - checkout scm - - poolInst = openPool(env_name, network_name) - - def testEnv = buildTestEnv(file, env_name) - - unstash name: "VCXLibindyAndLibnullpaySO${env_name}" - - echo "${env_name} Libvcx Test: Build" - testEnv.inside { - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ cargo build --features fatal_warnings - ''' - } - - sh "cp vcx/libvcx/target/debug/libvcx.so vcx/wrappers/node" - sh "cp vcx/libvcx/target/debug/libvcx.so vcx/wrappers/java" - sh "cp vcx/libvcx/target/debug/libvcx.so vcx/wrappers/python3" - - stash includes: 'vcx/wrappers/node/libvcx.so', name: "VcxNodeLibvcxSO${env_name}" - stash includes: 'vcx/wrappers/java/libvcx.so', name: "VcxJavaLibvcxSO${env_name}" - stash includes: 'vcx/wrappers/python3/libvcx.so', name: "VcxPythonLibvcxSO${env_name}" - - libvcxBuildFinished[env_name] = true - - sh "cp vcx/libvcx/libindy.so vcx/dummy-cloud-agent" - - testEnv.inside("--network=${network_name}") { - sh ''' - cd vcx/dummy-cloud-agent - sed -i 's/\\("protocol_type": "\\)2.0/\\11.0/' config/sample-config.json - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy=info cargo build - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy=info cargo run config/sample-config.json & - ''' - - echo "${env_name} Libvcx Test: Run tests" - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --features "pool_tests agency" - ''' - } - - testEnv.inside("--network=${network_name}") { - sh ''' - cd vcx/dummy-cloud-agent - sed -i 's/\\("protocol_type": "\\)1.0/\\12.0/' config/sample-config.json - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy=info cargo run config/sample-config.json & - ''' - - echo "${env_name} Libvcx Test: Run vcx demo test for protocol version 2.0" - // TODO in Rust 1.39.0 there was a problem with test name before "--". Temporary put test name after it. - sh ''' - cd vcx/libvcx - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --features "pool_tests agency_v2" -- tests::test_real_proof_for_protocol_type_v2 --exact - LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=vcx=debug,indy=debug RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --features "pool_tests aries" -- v3::test::aries_demo --exact - ''' - } - } - finally { - closePool(env_name, network_name, poolInst) - } -} - def linuxModuleTesting(file, env_name, network_name, module_tester) { linuxModuleTesting(file, env_name, network_name, module_tester, "ubuntu") } @@ -626,7 +483,7 @@ def linuxAndroidOnEmulatorTesting(env_name, network_name, testEnv) { def emu_arch = "x86" testEnv.inside("--network=${network_name}") { - for (directory in ["libindy", "libnullpay", "vcx/libvcx"]) { + for (directory in ["libindy", "libnullpay"]) { echo "${env_name} ${directory} Test: Test on ${emu_arch} emulator" sh "cd ${directory} && ./android.test.sh ${emu_arch}" } @@ -640,12 +497,6 @@ def linuxIndyWrappersTesting(env_name, network_name, testEnv) { linuxRustTesting(env_name, network_name, testEnv) } -def linuxVcxWrappersTesting(env_name, network_name, testEnv) { - linuxVcxNodejsTesting(env_name, network_name, testEnv) - linuxVcxJavaTesting(env_name, network_name, testEnv) - linuxVcxPythonTesting(env_name, network_name, testEnv) -} - def linuxJavaTesting(env_name, network_name, testEnv) { unstash name: "LibindyJavaSO${env_name}" dir('wrappers/java') { @@ -685,50 +536,6 @@ def linuxNodejsTesting(env_name, network_name, testEnv) { } } -def linuxVcxNodejsTesting(env_name, network_name, testEnv) { - unstash name: "VcxNodeLibvcxSO${env_name}" - unstash name: "VcxNodeLibindyAndLibnullpaySO${env_name}" - - testEnv.inside("--network=${network_name}") { - echo "${env_name} Vcx Test: Test nodejs wrapper" - sh ''' - cd vcx/wrappers/node/ - npm i - npm run compile - LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} LIBVCX_PATH=./ npm test - ''' - } -} - -def linuxVcxJavaTesting(env_name, network_name, testEnv) { - unstash name: "VcxJavaLibvcxSO${env_name}" - unstash name: "VcxJavaLibindyAndLibnullpaySO${env_name}" - - dir('vcx/wrappers/java') { - echo "${env_name} Vcx Test: Test java wrapper" - - testEnv.inside("--network=${network_name}") { - sh 'LIBRARY_PATH=./ LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} ./gradlew --no-daemon test' - } - } -} - -def linuxVcxPythonTesting(env_name, network_name, testEnv) { - unstash name: "VcxPythonLibvcxSO${env_name}" - unstash name: "VcxPythonLibindyAndLibnullpaySO${env_name}" - - dir('vcx/wrappers/python3') { - testEnv.inside("--network=${network_name}") { - echo "${env_name} Vcx Test: Test python wrapper" - - sh ''' - python3 -m pip install --user pytest==3.6.4 pytest-asyncio==0.10.0 - LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} python3 -m pytest -s - ''' - } - } -} - def linuxCLITesting(env_name, network_name, testEnv) { unstash name: "LibindyCliSO${env_name}" unstash name: "LibnullpayCliSO${env_name}" @@ -758,19 +565,6 @@ def linuxRustTesting(env_name, network_name, testEnv) { } } -def linuxCloudAgentTesting(env_name, network_name, testEnv) { - unstash name: "LibindyCloudAgentSO${env_name}" - - echo "${env_name} Cloud Agent Test: tests" - testEnv.inside { - sh ''' - cd vcx/dummy-cloud-agent - LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run - LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug RUST_TEST_THREADS=1 cargo test - ''' - } -} - def getBuildPoolVerOptions(pool_type, plenum_ver, anoncreds_ver, node_ver) { if (pool_type != null && plenum_ver != null && anoncreds_ver != null && node_ver != null) { return "--build-arg=indy_stream=${pool_type} --build-arg indy_plenum_ver=${plenum_ver} --build-arg indy_anoncreds_ver=${anoncreds_ver} --build-arg indy_node_ver=${node_ver}" diff --git a/vcx/ci/Jenkinsfile b/vcx/ci/Jenkinsfile deleted file mode 100644 index b80551c7b6..0000000000 --- a/vcx/ci/Jenkinsfile +++ /dev/null @@ -1,428 +0,0 @@ -#!groovy - -def rust -def vcx_python -def libindy -def libvcx -def vcx_nodejs - -// ******** Artifacts Created ******** -// libvcx_.deb (Debian Installable Library) ----> published Debian to https://repo.corp.evernym.com/deb/pool/main/libv/libvcx/ -// vcx_.deb (Nodejs Wrapper Debian Package) ----> archived with Jenkins and Published to repo.corp.evernym.com/deb/pool -// vcx_.tgz (Nodejs Wrapper Npm Installable Package) ----> published with Filely to https://repo.corp.evernym.com/filely/npm/ -// python3-vcx-wrapper-.tar.gz (Python Installable package) ----> published with Filely to https://kraken.corp.evernym.com/repo/python/upload -// ********* OTHERS ******** -// DEPRECATED ( NO LONGER PRODUCED ) libvcx.tar.gz (libvcx.so file and provision_agent_keys.py) ----> archived with Jenkins -class Globals { - - static String rustVersion = "1.37.0" - - static String libindyVersion = "1.10.1" - - static String libindyTag = "" - - static String libnullVersion = "1.10.1" - - static String nullpayTag = "" - - static String libsovtokenVersion = "1.0.0" - - static String androidSovtokenArtifact = "libsovtoken_1.0.0-201907031231-e7dde6e_all.zip " - - static String iosSovtokenArtifact = "libsovtoken_1.0.0-201907031239-e7dde6e_all.zip" - - static String indyBranch = 'stable' - - static String nullBranch = 'stable' - - static String vcxVersion = null - - static String vcxRevision = null -} - -testing() - -def testing() { - vcxVersion() - if (Globals.vcxVersion && Globals.vcxRevision) { - echo "VCX Version: ${Globals.vcxVersion}" - echo "VCX revision: ${Globals.vcxRevision}" - echo "Full VCX version: ${full_vcx_version()}" - - stage('Testing') { - parallel([ - 'Xenial' : { mainUbuntu() }, - 'Android': { android() }, - 'iOS' : { ios() } - ]) - } - } else { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "vcx version not found" - } -} - -def buildLibindyDocker() { - def libindyDockerfile = 'vcx/ci/libindy.dockerfile' - def indyTag = appendTag(Globals.libindyTag, "~") - - def nullTag= appendTag(Globals.nullpayTag, "~") - - docker.build("libindy", "--build-arg LIBINDY_VER=${Globals.libindyVersion}${indyTag} \ - --build-arg LIBNULL_VER=${Globals.libnullVersion}${nullTag} \ - --build-arg LIBSOVTOKEN_VER=${Globals.libsovtokenVersion} \ - -f ${libindyDockerfile} .") -} - -def buildAndroidDocker() { - def uid= sh(returnStdout: true, script: 'id -u').trim() - android = docker.build("android", "--build-arg uid=${uid} --build-arg RUST_VER=${Globals.rustVersion} -f vcx/wrappers/java/ci/android.dockerfile .") -} - - -def getUserUid() { - return sh(returnStdout: true, script: 'id -u').trim() -} - - -def build(name, file, context='.', customParams = '') { - return docker.build("$name", "${customParams} --build-arg uid=${getUserUid()} -f $file $context") -} - -static String appendTag(tag, del) { - if (tag == null) {tag = ""} - if (tag != "") { tag = del + tag } - return tag -} - -static String full_vcx_version() { - return Globals.vcxVersion + "-" + Globals.vcxRevision -} - -def vcxVersion() { - node('ubuntu') { - - try { - checkout scm - - libindy = buildLibindyDocker() - def scripts_path = "vcx/ci/scripts" - stage('Retrieve VCX version for ios & android') { - libindy.inside { - pwd = sh( - returnStdout: true, - script: 'pwd' - ).trim() - sh "cd vcx/libvcx && ./../ci/scripts/cargo-update-version" - Globals.vcxRevision = sh( - returnStdout: true, - script: 'git rev-parse --short HEAD' - ).trim() - Globals.vcxVersion = sh( - returnStdout: true, - script: "./${scripts_path}/toml_utils.py ${pwd}/vcx/libvcx/Cargo.toml" - ).trim() - } - - } - - } catch (Exception ex) { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "$ex error" - } finally { - sh 'docker system df' - step([$class: 'WsCleanup']) - } - } -} - -def mainUbuntu() { - node('ubuntu') { - - try { - checkout scm - def libvcxDockerfile = 'vcx/ci/libvcx.dockerfile' - def pythonDockerfile = 'vcx/ci/python.dockerfile' - def nodeDockerfile = 'vcx/wrappers/node/ci/node.dockerfile' - def javaDockerfile = 'vcx/wrappers/java/ci/java.dockerfile' - def uid= sh(returnStdout: true, script: 'id -u').trim() - def cwd= sh(returnStdout: true, script: 'pwd').trim() - def python - def node - def java - - // set this to '--no-test' and the rust code will not run tests. - def rustTestFlag="test" - - stage('Build Libindy Image') { - // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) - buildLibindyDocker() - } - - sh 'mkdir -p output' - sh 'rm -rf output/*' - stage('Build Libvcx Image and Tests Rust Code') { - libvcx = docker.build("libvcx", "--build-arg uid=${uid} --build-arg RUST_VER=${Globals.rustVersion} -f ${libvcxDockerfile} .") - libvcx.inside { - sh "vcx/ci/scripts/package.sh ${rustTestFlag} ${Globals.vcxVersion} ${Globals.vcxRevision}" - } - } - - stage('Test Python Wrapper'){ - python = docker.build("python", "--build-arg uid=${uid} -f ${pythonDockerfile} .") - withEnv(["PYTHONPATH=${cwd}/vcx/wrappers/python3:vcx/wrappers/python3"]){ - python.inside() { - sh 'vcx/wrappers/python3/ci/test.sh' - } - } - } - stage('Test Node Wrapper') { - node = docker.build('node', "--build-arg uid=${uid} -f ${nodeDockerfile} .") - node.inside() { - sh 'vcx/wrappers/node/ci/test.sh' - } - } - stage('Test Java Wrapper'){ - java = docker.build("java", "--build-arg uid=${uid} -f ${javaDockerfile} .") - java.inside() { - sh 'cd vcx/wrappers/java && ./gradlew --no-daemon test' - } - } - stage('Package Python Wrapper') { - python.inside() { - sh 'vcx/wrappers/python3/ci/package.sh' - } - } - stage('Package Node Wrapper') { - node.inside() { - sh 'vcx/wrappers/node/ci/package.sh' - - } - } - stage('Package Java Wrapper') { - java.inside() { - sh 'vcx/wrappers/java/ci/buildJar.sh $(python3 vcx/ci/scripts/toml_utils.py vcx/libvcx/Cargo.toml)' - } - } - // debug info - sh 'ls -al output' - if (env.BRANCH_NAME == "master") { - stage('Publish') { - // ******** PUBLISHING (artifacts are in a Docker Volume) ******** - withCredentials([usernameColonPassword(credentialsId: 'jenkins-kraken-svc', variable: 'KRAKEN_CREDENTIALS')]) { - libvcx.inside("--network=host") { - - // ******** Archive with Jenkins ******** - archiveArtifacts allowEmptyArchive: true, artifacts: 'output/*' - - // ******** Publish Libvcx Debian to repo ******** - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"libvcx*.deb\" https://kraken.corp.evernym.com/repo/portal_dev/upload" - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"libvcx*.deb\" https://kraken.corp.evernym.com/repo/agency_dev/upload" - - // ******** Publish vcx Debian To Repo (NPM PACKAGES) For Agency - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/agency_dev/upload" - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"vcx_*.deb\" https://kraken.corp.evernym.com/repo/portal_dev/upload" - - // ******** Publish Npm Package to filely repo ******** - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"node-vcx-wrapper*.tgz\" https://kraken.corp.evernym.com/repo/npm/upload" - - // ******** Publish Python Package to filely repo ********* - sh "vcx/ci/scripts/publish.sh \"${KRAKEN_CREDENTIALS}\" \"python3-vcx-wrapper*.tar.gz\" https://kraken.corp.evernym.com/repo/python/upload" - } - } - withCredentials([file(credentialsId: 'cloudrepo-artifactory-settings-libvcx', variable: 'settingsFile')]) { - java.inside() { - sh 'cp $settingsFile .' - sh "chmod +x vcx/wrappers/java/ci/publishJar.sh" - sh 'vcx/wrappers/java/ci/publishJar.sh' - } - } - } - } - } catch (Exception ex) { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "$ex error" - } finally { - sh 'docker system df' - step([$class: 'WsCleanup']) - } - } -} - -def android() { - - stage('Android Build') { - parallel([ - "x86" : { buildAndroid("x86") }, - "x86_64" : { buildAndroid("x86_64") }, - "arm" : { buildAndroid("arm") }, - "arm64" : { buildAndroid("arm64") }, - "armv7" : { buildAndroid("armv7") } - ]) - } - node('ubuntu') { - try { - checkout scm - - stage('Build Libindy Image') { - // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) - buildLibindyDocker() - } - buildAndroidDocker() - stage('Android Packaging') { - //Package .so files into .aar - packageAndroid(android) - } - stage('Android Publishing') { - if (env.BRANCH_NAME == "master") { - //Publish package on aptly - publishAndroid(android) - } - } - } catch (Exception ex) { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "$ex error" - } finally { - sh 'docker system df' - step([$class: 'WsCleanup']) - } - } -} - -def ios() { - - node('macos-vcx') { - checkout scm - stage('iOS Build') { - try { - SCRIPTS_PATH="vcx/libvcx/build_scripts/ios/mac" - WORK_DIR = "/Users/jenkins" - - // Build ios architectures - - def indyTag = appendTag(Globals.libindyTag, "-") - def nullTag = appendTag(Globals.nullpayTag, "-") - - sh "source vcx/ci/scripts/iosBuild.sh ${Globals.indyBranch} ${Globals.libindyVersion}${indyTag} \ - ${Globals.nullBranch} ${Globals.libnullVersion}${nullTag} ${Globals.iosSovtokenArtifact} \ - ${Globals.rustVersion} ${full_vcx_version()}" - - if (env.BRANCH_NAME == "master") { - withCredentials([usernameColonPassword(credentialsId: 'jenkins-kraken-svc', variable: 'KRAKEN_CREDENTIALS')]) { - // ******** Archive with Jenkins ******** - archiveArtifacts allowEmptyArchive: true, artifacts: "/Users/jenkins/IOSBuilds/libvcxpartial/vcx.libvcxpartial_${full_vcx_version()}_universal.zip" - archiveArtifacts allowEmptyArchive: true, artifacts: "/Users/jenkins/IOSBuilds/libvcxpartial/libvcx.a.libvcxpartial_${full_vcx_version()}.tar.gz" - archiveArtifacts allowEmptyArchive: true, artifacts: "/Users/jenkins/IOSBuilds/libvcxall/vcx.libvcxall_${full_vcx_version()}_universal.zip" - archiveArtifacts allowEmptyArchive: true, artifacts: "/Users/jenkins/IOSBuilds/libvcxall/libvcx.a.libvcxall_${full_vcx_version()}_universal.tar.gz" - - sh "find /Users/jenkins/IOSBuilds/libvcxpartial/ -type f -name 'vcx.libvcxpartial_*_universal.zip' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" - sh "find /Users/jenkins/IOSBuilds/libvcxpartial/ -type f -name 'libvcx.a.libvcxpartial_*_universal.tar.gz' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" - sh "find /Users/jenkins/IOSBuilds/libvcxall/ -type f -name 'vcx.libvcxall_*_universal.zip' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" - sh "find /Users/jenkins/IOSBuilds/libvcxall/ -type f -name 'libvcx.a.libvcxall_*_universal.tar.gz' -exec curl -u \"${KRAKEN_CREDENTIALS}\" -X POST https://kraken.corp.evernym.com/repo/ios/upload -F 'file=@{}' \\;" - } - } - } catch (Exception ex) { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "$ex error" - } finally { - step([$class: 'WsCleanup']) - } - } - } -} - -def fail() { - - def message = [ - message: "$JOB_NAME - Build # $BUILD_NUMBER - fail: Check console output at $BUILD_URL to view the results." - ] - slackSend message -} - -def buildAndroid(arch) { - - node('ubuntu') { - try { - checkout scm - - stage('Build Libindy Image') { - // ******** Build the libindy base image (pulls down dependent debians from sovrin repo, and installs a majority of the dependencies) - buildLibindyDocker() - } - stage('Build and Publish Android') { - buildAndroidDocker() - android.inside { - ANDROID_SCRIPT_PATH = 'vcx/ci/scripts/androidBuild.sh' - - sh 'sudo ./vcx/ci/scripts/installCert.sh' - - def indyTag = appendTag(Globals.libindyTag, "-") - def nullTag = appendTag(Globals.nullpayTag, "-") - - sh "./${ANDROID_SCRIPT_PATH} ${arch} ${Globals.indyBranch} ${Globals.libindyVersion}${indyTag} \ - ${Globals.nullBranch} ${Globals.libnullVersion}${nullTag} ${Globals.androidSovtokenArtifact}" - - } - - dir("runtime_android_build/libvcx_${arch}") { - stash includes: "libvcx.so,libz.so,liblog.so,libc++_shared.so", name: "libvcx_${arch}" - } - } - } catch (Exception ex) { - currentBuild.result = "FAILED" - if (env.BRANCH_NAME == "master") { - fail() - } - echo "$ex error" - } finally { - sh 'docker system df' - step([$class: 'WsCleanup']) - } - } -} - -def packageAndroid(android) { - all_archs = ["arm", "arm64", "armv7", "x86", "x86_64"] - for (arch in all_archs) { - dir("runtime_android_build/libvcx_${arch}") { - unstash name: "libvcx_${arch}" - } - } - android.inside { - ANDROID_SCRIPT_PATH = 'vcx/ci/scripts/androidPackage.sh' - sh "chmod +x ${ANDROID_SCRIPT_PATH}" - sh "./${ANDROID_SCRIPT_PATH}" - } -} - -def publishAndroid(envn) { - envn.inside { - withCredentials([file(credentialsId: 'cloudrepo-artifactory-settings-libvcx', variable: 'settingsFile')]) { - sh 'cp $settingsFile .' - ANDROID_SCRIPT_PATH = 'vcx/ci/scripts/androidPublish.sh' - sh "chmod +x ${ANDROID_SCRIPT_PATH}" - sh "./${ANDROID_SCRIPT_PATH} ${full_vcx_version()}" - } - - withCredentials([usernameColonPassword(credentialsId: 'jenkins-kraken-svc', variable: 'KRAKEN_CREDENTIALS')]) { - artifactLocation='vcx/wrappers/java/artifacts/aar' - artifactName="com.evernym-vcx_${full_vcx_version()}_x86-armv7-release.aar" - archiveArtifacts allowEmptyArchive: true, artifacts: "${artifactLocation}/${artifactName}" - } - } -}