diff --git a/.jenkinsci/artifacts.groovy b/.jenkinsci/artifacts.groovy deleted file mode 100644 index b41aa74cc4c..00000000000 --- a/.jenkinsci/artifacts.groovy +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Upload Artifacts to nexus -// - -def uploadArtifacts(filePaths, uploadPath, artifactServers=['nexus.iroha.tech']) { - def filePathsConverted = [] - def agentType = sh(script: 'uname -sm', returnStdout: true).trim() - filePaths.each { - def fp = sh(script: "ls -d ${it} | tr '\n' ','", returnStdout: true).trim() - filePathsConverted.addAll(fp.split(',')) - } - def shaSumBinary = 'sha256sum' - def md5SumBinary = 'md5sum' - def gpgKeyBinary = 'gpg --armor --detach-sign --no-tty --batch --yes --passphrase-fd 0' - if (agentType == 'Darwin x86_64') { - shaSumBinary = 'shasum -a 256' - md5SumBinary = 'md5 -r' - gpgKeyBinary = 'GPG_TTY=\$(tty) gpg --pinentry-mode loopback --armor --detach-sign --no-tty --batch --yes --passphrase-fd 0' - } else if (agentType == 'Linux s390x') { - gpgKeyBinary = 'gpg --pinentry-mode loopback --armor --detach-sign --no-tty --batch --yes --passphrase-fd 0' - } - sh "> \$(pwd)/batch.txt" - - withCredentials([file(credentialsId: 'ci_gpg_privkey', variable: 'CI_GPG_PRIVKEY'), string(credentialsId: 'ci_gpg_masterkey', variable: 'CI_GPG_MASTERKEY')]) { - if (!agentType.contains('MSYS_NT')) { - sh "gpg --yes --batch --no-tty --import ${CI_GPG_PRIVKEY} || true" - } - filePathsConverted.each { - sh "echo ${it} >> \$(pwd)/batch.txt;" - sh "$shaSumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).sha256" - sh "$md5SumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).md5" - if (!agentType.contains('MSYS_NT')) { - sh "echo \"${CI_GPG_MASTERKEY}\" | $gpgKeyBinary -o \$(pwd)/\$(basename ${it}).ascfile ${it}" - sh "echo \$(pwd)/\$(basename ${it}).ascfile >> \$(pwd)/batch.txt;" - } - sh "echo \$(pwd)/\$(basename ${it}).sha256 >> \$(pwd)/batch.txt;" - sh "echo \$(pwd)/\$(basename ${it}).md5 >> \$(pwd)/batch.txt;" - } - } - - withCredentials([usernamePassword(credentialsId: 'ci_nexus', passwordVariable: 'NEXUS_PASS', usernameVariable: 'NEXUS_USER')]) { - artifactServers.each { - sh(script: "while read line; do curl --http1.1 -u ${NEXUS_USER}:${NEXUS_PASS} --upload-file \$line https://${it}/repository/artifacts/${uploadPath}/ ; done < \$(pwd)/batch.txt") - } - } -} - -return this - diff --git a/.jenkinsci/build.groovy b/.jenkinsci/build.groovy deleted file mode 100644 index 86c1bad47ee..00000000000 --- a/.jenkinsci/build.groovy +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// functions we use when build iroha -// - -def removeDirectory(String buildDir) { - sh "rm -rf ${buildDir}" -} - -def cmakeConfigure(String buildDir, String cmakeOptions, String sourceTreeDir=".") { - sh "cmake -H${sourceTreeDir} -B${buildDir} ${cmakeOptions}" -} - -def cmakeBuild(String buildDir, String cmakeOptions, int parallelism) { - sh "cmake --build ${buildDir} ${cmakeOptions} -- -j${parallelism}" - sh "ccache --show-stats" -} - -def cmakeBuildWindows(String buildDir, String cmakeOptions) { - sh "cmake --build ${buildDir} ${cmakeOptions}" -} - -def cppCheck(String buildDir, int parallelism) { - // github.com/jenkinsci/cppcheck-plugin/pull/36 - sh "cppcheck -j${parallelism} --enable=all -i${buildDir} --template='{file},,{line},,{severity},,{id},,{message}' --xml --xml-version=2 . 2> cppcheck.xml" - recordIssues(tools: [cppCheck(pattern: 'cppcheck.xml')]) -} - -def sonarScanner(scmVars, environment) { - withEnv(environment) { - withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN'), string(credentialsId: 'SORABOT_TOKEN', variable: 'SORABOT_TOKEN')]) { - def sonar_option = "" - if (env.CHANGE_ID != null) { - sonar_option = "-Dsonar.github.pullRequest=${env.CHANGE_ID}" - } - else { - print "************** Warning No 'CHANGE_ID' Present run sonar without org.sonar.plugins.github.PullRequest *****************" - } - // do analysis by sorabot - sh """ - sonar-scanner \ - -Dsonar.github.disableInlineComments=true \ - -Dsonar.github.repository='${env.DOCKER_REGISTRY_BASENAME}' \ - -Dsonar.login=${SONAR_TOKEN} \ - -Dsonar.projectVersion=${BUILD_TAG} \ - -Dsonar.github.oauth=${SORABOT_TOKEN} ${sonar_option} - """ - if (scmVars.GIT_BRANCH == "main" ) - // push analysis results to sonar - sh """ - sonar-scanner \ - -Dsonar.login=${SONAR_TOKEN} - """ - } - } -} - -def clangFormat (scmVars, environment) { - withEnv(environment) { - if (env.CHANGE_TARGET){ - sh""" - git diff origin/${env.CHANGE_TARGET} --name-only | grep -E '\\.(cc|cpp|cxx|C|c\\+\\+|c|CPP|h|hpp|hh|icc)\$' | xargs clang-format-7 -style=file -i || true - git diff | tee clang-format-report.txt - if [ \$(cat clang-format-report.txt | wc -l ) -eq 0 ]; then - echo "All clean!" >> clang-format-report.txt - fi - git reset HEAD --hard - """ - archiveArtifacts artifacts: 'clang-format-report.txt', allowEmptyArchive: true - } - else - print "This is not a PR, env.CHANGE_TARGET not found" - } -} - -def initialCoverage(String buildDir) { - sh "cmake --build ${buildDir} --target coverage.init.info" -} - -def postCoverage(buildDir, String cobertura_bin) { - sh "cmake --build ${buildDir} --target coverage.info" - sh "python ${cobertura_bin} ${buildDir}/reports/coverage.info -o ${buildDir}/reports/coverage.xml" - cobertura autoUpdateHealth: false, autoUpdateStability: false, - coberturaReportFile: "**/${buildDir}/reports/coverage.xml", conditionalCoverageTargets: '75, 50, 0', - failUnhealthy: false, failUnstable: false, lineCoverageTargets: '75, 50, 0', maxNumberOfBuilds: 50, - methodCoverageTargets: '75, 50, 0', onlyStable: false, zoomCoverageChart: false -} -return this diff --git a/.jenkinsci/builders/x64-linux-build-steps.groovy b/.jenkinsci/builders/x64-linux-build-steps.groovy deleted file mode 100644 index afc330495fb..00000000000 --- a/.jenkinsci/builders/x64-linux-build-steps.groovy +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Linux Build steps -// - -def dockerManifestPush(dockerImageObj, String dockerTag, environment) { - def manifest = load ".jenkinsci/utils/docker-manifest.groovy" - withEnv(environment) { - if (manifest.manifestSupportEnabled()) { - manifest.manifestCreate("${env.DOCKER_REGISTRY_BASENAME}:${dockerTag}", - ["${env.DOCKER_REGISTRY_BASENAME}:x86_64-${dockerTag}"]) - manifest.manifestAnnotate("${env.DOCKER_REGISTRY_BASENAME}:${dockerTag}", - [ - [manifest: "${env.DOCKER_REGISTRY_BASENAME}:x86_64-${dockerTag}", - arch: 'amd64', os: 'linux', osfeatures: [], variant: ''], - ]) - withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials', usernameVariable: 'login', passwordVariable: 'password')]) { - manifest.manifestPush("${env.DOCKER_REGISTRY_BASENAME}:${dockerTag}", login, password) - } - } - else { - echo('[WARNING] Docker CLI does not support manifest management features. Manifest will not be updated') - } - } -} - -def testSteps(String buildDir, List environment, String testList) { - withEnv(environment) { - sh "cd ${buildDir}; rm -f Testing/*/Test.xml; ctest --output-on-failure --no-compress-output --tests-regex '${testList}' --test-action Test || true" - sh """ python .jenkinsci/helpers/platform_tag.py "Linux \$(uname -m)" \$(ls ${buildDir}/Testing/*/Test.xml) """ - // Mark build as UNSTABLE if there are any failed tests (threshold <100%) - xunit testTimeMargin: '3000', thresholdMode: 2, thresholds: [passed(unstableThreshold: '100')], \ - tools: [CTest(deleteOutputFiles: true, failIfNotNew: false, \ - pattern: "${buildDir}/Testing/**/Test.xml", skipNoTestFiles: false, stopProcessingIfError: true)] - } -} - -def buildSteps(int parallelism, String compiler, String build_type, boolean build_shared_libs, boolean specialBranch, boolean coverage, - boolean testing, String testList, boolean cppcheck, boolean sonar, boolean codestyle, boolean docs, boolean packagebuild, boolean sanitize, - boolean fuzzing, boolean benchmarking, boolean coredumps, boolean useBTF, boolean use_libursa, boolean use_burrow, - boolean forceDockerDevelopBuild, boolean manifest_push, List environment) { - withEnv(environment) { - def scmVars, build, utils, doxygen, buildDir, compilers, cmakeBooleanOption, platform, cmakeBuildOptions, cmakeOptions, iC, postgresIP - stage('Prepare Linux environment') { - scmVars = checkout scm - build = load '.jenkinsci/build.groovy' - def vars = load ".jenkinsci/utils/vars.groovy" - utils = load ".jenkinsci/utils/utils.groovy" - def dockerUtils = load ".jenkinsci/utils/docker-pull-or-build.groovy" - doxygen = load ".jenkinsci/utils/doxygen.groovy" - buildDir = 'build' - compilers = vars.compilerMapping() - cmakeBooleanOption = [ (true): 'ON', (false): 'OFF' ] - platform = sh(script: 'uname -m', returnStdout: true).trim() - cmakeBuildOptions = "" - cmakeOptions = "" - if (packagebuild){ - cmakeBuildOptions = " --target package " - } - if (sanitize){ - cmakeOptions += " -DSANITIZE='address;leak' " - } - // enable coredumps collecting - if (coredumps) { - sh "echo %e.%p.coredump > /proc/sys/kernel/core_pattern" - sh "ulimit -c unlimited" - } - // Create postgres - // enable prepared transactions so that 2 phase commit works - // we set it to 100 as a safe value - sh """#!/bin/bash -xe - if [ ! "\$(docker ps -q -f name=${env.IROHA_POSTGRES_HOST})" ]; then - docker network create ${env.IROHA_NETWORK} - docker run -td -e POSTGRES_USER=${env.IROHA_POSTGRES_USER} \ - -e POSTGRES_PASSWORD=${env.IROHA_POSTGRES_PASSWORD} --name ${env.IROHA_POSTGRES_HOST} \ - --network=${env.IROHA_NETWORK} postgres:9.5-alpine -c 'max_prepared_transactions=100' - fi - """ - postgresIP = sh(script: "docker inspect ${env.IROHA_POSTGRES_HOST} --format '{{ (index .NetworkSettings.Networks \"${env.IROHA_NETWORK}\").IPAddress }}'", returnStdout: true).trim() - - def referenceBranchOrCommit = 'main' - if (scmVars.GIT_LOCAL_BRANCH == referenceBranchOrCommit && scmVars.GIT_PREVIOUS_COMMIT) { - referenceBranchOrCommit = scmVars.GIT_PREVIOUS_COMMIT - } - // fix for podman=1.9.3, `COPY vcpkg /tmp/vcpkg-vars` have different hash after each git clone - // Explicitly setting Access and Modification Time - sh "find vcpkg/ -exec touch -amt 203801011205.09 {} +" - iC = dockerUtils.dockerPullOrBuild("${platform}-develop-build", - "${env.GIT_RAW_BASE_URL}/${scmVars.GIT_COMMIT}/docker/develop/Dockerfile", - "${env.GIT_RAW_BASE_URL}/${referenceBranchOrCommit}/docker/develop/Dockerfile", - scmVars, - environment, - forceDockerDevelopBuild, - ['PARALLELISM': parallelism]) - } - iC.inside("" - + " -e IROHA_POSTGRES_HOST=${env.IROHA_POSTGRES_HOST}" - + " -e IROHA_POSTGRES_PORT=${env.IROHA_POSTGRES_PORT}" - + " -e IROHA_POSTGRES_USER=${env.IROHA_POSTGRES_USER}" - + " -e IROHA_POSTGRES_PASSWORD=${env.IROHA_POSTGRES_PASSWORD}" - + " --network=${env.IROHA_NETWORK}" - + " -v /data/jenkins/ccache:${env.CCACHE_DEBUG_DIR}:z" - + " --add-host ${env.IROHA_POSTGRES_HOST}:${postgresIP}") { - utils.ccacheSetup(5) - stage ("Build ${compiler} ${platform}"){ - // Remove artifacts from the previous build - build.removeDirectory(buildDir) - build.cmakeConfigure(buildDir, "-DCMAKE_CXX_COMPILER=${compilers[compiler]['cxx_compiler']} \ - -DCMAKE_C_COMPILER=${compilers[compiler]['cc_compiler']} \ - -DCMAKE_BUILD_TYPE=${build_type} \ - -DBUILD_SHARED_LIBS=${cmakeBooleanOption[build_shared_libs]} \ - -DCOVERAGE=${cmakeBooleanOption[coverage]} \ - -DTESTING=${cmakeBooleanOption[testing]} \ - -DFUZZING=${cmakeBooleanOption[fuzzing]} \ - -DBENCHMARKING=${cmakeBooleanOption[benchmarking]} \ - -DPACKAGE_DEB=${cmakeBooleanOption[packagebuild]} \ - -DPACKAGE_TGZ=${cmakeBooleanOption[packagebuild]} \ - -DUSE_BTF=${cmakeBooleanOption[useBTF]} \ - -DUSE_LIBURSA=${cmakeBooleanOption[use_libursa]} \ - -DUSE_BURROW=${cmakeBooleanOption[use_burrow]} \ - -DCMAKE_TOOLCHAIN_FILE=/opt/dependencies/scripts/buildsystems/vcpkg.cmake ${cmakeOptions}") - build.cmakeBuild(buildDir, cmakeBuildOptions, parallelism) - } - stage("Initial coverage ${compiler}") { - if (coverage) { - build.initialCoverage(buildDir) - } - } - stage("Test ${compiler}") { - if (testing) { - testSteps(buildDir, environment, testList) - } - } - stage("Post coverage ${compiler}") { - if (coverage) { - build.postCoverage(buildDir, '/tmp/lcov_cobertura.py') - } - } - stage("Analysis") { - if (cppcheck){ - build.cppCheck(buildDir, parallelism) - } - if (sonar) { - build.sonarScanner(scmVars, environment) - } - if (codestyle) { - build.clangFormat(scmVars, environment) - } - } - stage('Build docs'){ - if (docs) { - doxygen.doDoxygen() - } - } - } // end iC.inside - stage ('Docker ManifestPush'){ - if (manifest_push) { - utils.dockerPush(iC, "${platform}-develop-build") - dockerManifestPush(iC, "develop-build", environment) - } - } - } -} - -def successPostSteps(scmVars, boolean packagePush, String dockerTag, List environment) { - stage('Linux success PostSteps') { - withEnv(environment) { - if (packagePush) { - def artifacts = load ".jenkinsci/artifacts.groovy" - def utils = load ".jenkinsci/utils/utils.groovy" - def platform = sh(script: 'uname -m', returnStdout: true).trim() - def commit = scmVars.GIT_COMMIT - - // if we use several compilers only the last compiler, used for the build, will be used for iroha.deb and iroha.tar.gz archives - sh """ - ls -lah ./build - mv ./build/iroha-*-irohad.deb ./build/iroha.deb - mv ./build/iroha-*-iroha_shepherd.deb ./build/iroha_shepherd.deb - mv ./build/iroha-*.tar.gz ./build/iroha.tar.gz - cp ./build/iroha*.deb docker/release - mkdir -p build/artifacts - mv ./build/iroha*.deb ./build/iroha.tar.gz build/artifacts - """ - // publish docker - def iCRelease = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${commit}-${env.BUILD_NUMBER}-release", "--no-cache -f docker/release/Dockerfile ${WORKSPACE}/docker/release") - utils.dockerPush(iCRelease, "${platform}-${dockerTag}") - dockerManifestPush(iCRelease, dockerTag, environment) - sh "docker rmi ${iCRelease.id}" - - // publish packages - filePaths = [ './build/artifacts/iroha.deb', './build/artifacts/iroha_shepherd.deb', './build/artifacts/iroha.tar.gz' ] - artifacts.uploadArtifacts(filePaths, sprintf('/iroha/linux/%4$s/%1$s-%2$s-%3$s', [scmVars.GIT_LOCAL_BRANCH, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6), platform])) - } else { - archiveArtifacts artifacts: 'build/iroha*.tar.gz', allowEmptyArchive: true - archiveArtifacts artifacts: 'build/iroha*.deb', allowEmptyArchive: true - } - } - } -} - -def alwaysPostSteps(scmVars, List environment, boolean coredumps) { - stage('Linux always PostSteps') { - // handling coredumps (if tests crashed) - if (currentBuild.currentResult != "SUCCESS" && coredumps) { - def dumpsFileName = sprintf('coredumps-%1$s.bzip2', - [scmVars.GIT_COMMIT.substring(0,8)]) - - sh(script: "echo 'build/bin' > coredumps.upload") - sh(script: "find . -type f -name '*.coredump' -exec echo '{}' \\; >> coredumps.upload") - sh(script: "tar -cjvf ${dumpsFileName} -T coredumps.upload") - if( fileExists(dumpsFileName)) { - withCredentials([usernamePassword(credentialsId: 'ci_nexus', passwordVariable: 'NEXUS_PASS', usernameVariable: 'NEXUS_USER')]) { - sh(script: "curl -u ${NEXUS_USER}:${NEXUS_PASS} --upload-file ${WORKSPACE}/${dumpsFileName} https://nexus.iroha.tech/repository/artifacts/iroha/coredumps/${dumpsFileName}") - } - echo "Build is not SUCCESS! Download core dumps at: https://nexus.iroha.tech/repository/artifacts/iroha/coredumps/${dumpsFileName}" - } - } - withEnv(environment) { - sh "docker rm -f ${env.IROHA_POSTGRES_HOST} || true" - sh "docker network rm ${env.IROHA_NETWORK}" - cleanWs() - } - } -} - -return this diff --git a/.jenkinsci/builders/x64-mac-build-steps.groovy b/.jenkinsci/builders/x64-mac-build-steps.groovy deleted file mode 100644 index 155dab0e348..00000000000 --- a/.jenkinsci/builders/x64-mac-build-steps.groovy +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Mac Build steps -// - -def testSteps(scmVars, String buildDir, List environment, String testList) { - withEnv(environment) { - sh """#!/bin/bash - export IROHA_POSTGRES_PASSWORD=${IROHA_POSTGRES_PASSWORD}; \ - export IROHA_POSTGRES_USER=${IROHA_POSTGRES_USER}; \ - mkdir -p /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}; \ - initdb -D /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}/ -U ${IROHA_POSTGRES_USER} --pwfile=<(echo ${IROHA_POSTGRES_PASSWORD}); \ - pg_ctl -D /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}/ -o '-p 5433 -c max_prepared_transactions=100' -l /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}/events.log start; \ - ./docker/release/wait-for-it.sh -h localhost -p 5433 -t 30 -- true; \ - psql -h localhost -d postgres -p 5433 -U ${IROHA_POSTGRES_USER} --file=<(echo create database ${IROHA_POSTGRES_USER};) - """ - sh "cd build; IROHA_POSTGRES_HOST=localhost IROHA_POSTGRES_PORT=5433 ctest --output-on-failure --no-compress-output --tests-regex '${testList}' --test-action Test || true" - - sh 'python .jenkinsci/helpers/platform_tag.py "Darwin \$(uname -m)" \$(ls build/Testing/*/Test.xml)' - // Mark build as UNSTABLE if there are any failed tests (threshold <100%) - xunit testTimeMargin: '3000', thresholdMode: 2, thresholds: [passed(unstableThreshold: '100')], \ - tools: [CTest(deleteOutputFiles: true, failIfNotNew: false, \ - pattern: 'build/Testing/**/Test.xml', skipNoTestFiles: false, stopProcessingIfError: true)] - - sh """ - pg_ctl -D /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}/ stop && \ - rm -rf /var/jenkins/${scmVars.GIT_COMMIT}-${BUILD_NUMBER}/ - """ - } -} - -def buildSteps(int parallelism, List compilerVersions, String build_type, boolean coverage, boolean testing, String testList, - boolean packagebuild, boolean fuzzing, boolean benchmarking, boolean useBTF, boolean use_libursa, boolean use_burrow, List environment) { - withEnv(environment) { - def build, vars, utils - stage('Prepare Mac environment') { - scmVars = checkout scm - build = load '.jenkinsci/build.groovy' - vars = load ".jenkinsci/utils/vars.groovy" - utils = load ".jenkinsci/utils/utils.groovy" - buildDir = 'build' - compilers = vars.compilerMapping() - cmakeBooleanOption = [ (true): 'ON', (false): 'OFF' ] - cmakeBuildOptions = "" - mac_local_vcpkg_hash = sh(script: "python .jenkinsci/helpers/hash.py vcpkg", returnStdout: true).trim() - mac_vcpkg_path = "/opt/dependencies/vcpkg-${mac_local_vcpkg_hash}" - mac_vcpkg_toolchain_file = "${mac_vcpkg_path}/scripts/buildsystems/vcpkg.cmake" - - if (packagebuild){ - cmakeBuildOptions = " --target package " - } - - utils.ccacheSetup(5) - utils.build_vcpkg(mac_vcpkg_path,mac_vcpkg_toolchain_file) - } - compilerVersions.each { compiler -> - stage ("build ${compiler}"){ - // Remove artifacts from the previous build - build.removeDirectory(buildDir) - build.cmakeConfigure(buildDir, - "-DCMAKE_CXX_COMPILER=${compilers[compiler]['cxx_compiler']} \ - -DCMAKE_C_COMPILER=${compilers[compiler]['cc_compiler']} \ - -DCMAKE_BUILD_TYPE=${build_type} \ - -DCOVERAGE=${cmakeBooleanOption[coverage]} \ - -DTESTING=${cmakeBooleanOption[testing]} \ - -DFUZZING=${cmakeBooleanOption[fuzzing]} \ - -DBENCHMARKING=${cmakeBooleanOption[benchmarking]} \ - -DPACKAGE_TGZ=${cmakeBooleanOption[packagebuild]} \ - -DUSE_BTF=${cmakeBooleanOption[useBTF]} \ - -DPython3_FIND_STRATEGY=LOCATION \ - -DUSE_LIBURSA=${cmakeBooleanOption[use_libursa]} \ - -DUSE_BURROW=${cmakeBooleanOption[use_burrow]} \ - -DCMAKE_TOOLCHAIN_FILE=${mac_vcpkg_toolchain_file} ") - - build.cmakeBuild(buildDir, cmakeBuildOptions, parallelism) - } - if (testing) { - stage("Test ${compiler}") { - coverage ? build.initialCoverage(buildDir) : echo('Skipping initial coverage...') - testSteps(scmVars, buildDir, environment, testList) - coverage ? build.postCoverage(buildDir, '/usr/local/bin/lcov_cobertura.py') : echo('Skipping post coverage...') - // We run coverage once, using the first compiler as it is enough - coverage = false - } - } - } - } -} - -def successPostSteps(scmVars, boolean packagePush, List environment) { - stage('Mac success PostSteps') { - withEnv(environment) { - timeout(time: 600, unit: "SECONDS") { - if (packagePush) { - def artifacts = load ".jenkinsci/artifacts.groovy" - def commit = scmVars.GIT_COMMIT - // if we use several compilers only the last compiler, used for the build, will be used for iroha.tar.gz archive - sh """ - ls -lah ./build - mv ./build/iroha-*.tar.gz ./build/iroha.tar.gz - """ - // publish packages - filePaths = [ '\$(pwd)/build/*.tar.gz' ] - artifacts.uploadArtifacts(filePaths, sprintf('iroha/macos/%1$s-%2$s-%3$s', [scmVars.GIT_LOCAL_BRANCH, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])) - } else { - archiveArtifacts artifacts: 'build/iroha*.tar.gz', allowEmptyArchive: true - } - } - } - } -} - -def alwaysPostSteps(List environment) { - stage('Mac always PostSteps') { - withEnv(environment) { - sh ''' - set -x - PROC=$( ps uax | grep postgres | grep 5433 | grep -o "/var/jenkins/.*" | cut -d' ' -f1 ) - if [ -n "${PROC}" ]; then - pg_ctl -D ${PROC}/ stop - rm -rf ${PROC} - fi - ''' - cleanWs() - } - } -} -return this diff --git a/.jenkinsci/builders/x64-win-build-steps.groovy b/.jenkinsci/builders/x64-win-build-steps.groovy deleted file mode 100644 index 924a6af5046..00000000000 --- a/.jenkinsci/builders/x64-win-build-steps.groovy +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Windows Build steps -// - -def testSteps(String buildDir, List environment, String testList) { - withEnv(environment) { - bat "cd .\\${buildDir} & del /q /f /s Test.xml & ctest --output-on-failure --no-compress-output --tests-regex \"${testList}\" --test-action Test || exit 0" - bat "for /f \"usebackq tokens=*\" %%a in (`dir .\\${buildDir} /s /b ^| findstr Testing ^| findstr Test.xml`) do python .\\.jenkinsci\\helpers\\platform_tag.py \"Windows %PROCESSOR_ARCHITECTURE%\" %%a" - bat "for /f \"usebackq tokens=*\" %%a in (`dir .\\${buildDir} /s /b ^| findstr Testing ^| findstr Test.xml`) do python .\\.jenkinsci\\helpers\\transform_xml.py .\\.jenkinsci\\helpers\\ctest-to-junit.xsl %%a" - junit "${buildDir}/Testing/**/Test.xml" - } -} - -def buildSteps(int parallelism, List compilerVersions, String buildType, boolean coverage, boolean testing, String testList, - boolean packageBuild, boolean benchmarking, boolean useBTF, List environment) { - withEnv(environment) { - def utils - stage('Prepare Windows environment') { - scmVars = checkout scm - buildDir = 'build' - utils = load ".jenkinsci/utils/utils.groovy" - cmakeBooleanOption = [ (true): 'ON', (false): 'OFF' ] - - win_local_vcpkg_hash = bat(script: "python .jenkinsci\\helpers\\hash.py vcpkg", returnStdout: true).trim().readLines()[-1].trim() - win_vcpkg_path = "C:\\vcpkg-${win_local_vcpkg_hash}" - win_vcpkg_toolchain_file = "${win_vcpkg_path}\\scripts\\buildsystems\\vcpkg.cmake" - - utils.build_vcpkg(win_vcpkg_path,win_vcpkg_toolchain_file) - } - compilerVersions.each { compiler -> - stage ("build ${compiler}"){ - bat """ -call \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat\" &&^ -cmake -H.\\ -B.\\${buildDir} -DCMAKE_BUILD_TYPE=${buildType} -DTESTING=${cmakeBooleanOption[testing]} -DBENCHMARKING=${cmakeBooleanOption[benchmarking]} -DUSE_BTF=${cmakeBooleanOption[useBTF]} -DCMAKE_TOOLCHAIN_FILE=${win_vcpkg_toolchain_file} -GNinja &&^ -cmake --build .\\${buildDir} -- -j${parallelism} - """ - } - if (testing) { - stage("Test ${compiler}") { - // coverage ? build.initialCoverage(buildDir) : echo('Skipping initial coverage...') - testSteps(buildDir, environment, testList) - // coverage ? build.postCoverage(buildDir, '/tmp/lcov_cobertura.py') : echo('Skipping post coverage...') - // We run coverage once, using the first compiler as it is enough - // coverage = false - } - } //end if - } //end for - } -} - -def successPostSteps(scmVars, boolean packagePush, List environment) { - stage('Windows success PostSteps') { - withEnv(environment) { - if (packagePush){ - timeout(time: 600, unit: "SECONDS") { - archiveArtifacts artifacts: 'build\\bin\\Debug\\iroha*.exe', allowEmptyArchive: true - } - } - } - } -} - -def alwaysPostSteps(List environment) { - stage('Windows always PostSteps') { - withEnv(environment) { - cleanWs() - } - } -} -return this diff --git a/.jenkinsci/helpers/ctest-to-junit.xsl b/.jenkinsci/helpers/ctest-to-junit.xsl deleted file mode 100644 index 3b3e629e4fa..00000000000 --- a/.jenkinsci/helpers/ctest-to-junit.xsl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.jenkinsci/helpers/hash.py b/.jenkinsci/helpers/hash.py deleted file mode 100755 index f41c7a755ed..00000000000 --- a/.jenkinsci/helpers/hash.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python - -import hashlib -import argparse -import os - -WINDOWS_LINE_ENDING = b'\r\n' -UNIX_LINE_ENDING = b'\n' - - -def md5_update_from_dir(directory, hash): - assert os.path.isdir(directory) - for root, dirnames, filenames in os.walk(directory): - for file in sorted(filenames, key=lambda p: str(p).lower()): - # If you need include file name to hash uncomment this - #hash.update(file.encode()) - with open(os.path.join(root, file), "rb") as f: - hash.update(f.read().replace(WINDOWS_LINE_ENDING, UNIX_LINE_ENDING)) - for path in sorted(dirnames, key=lambda p: str(p).lower()): - hash = md5_update_from_dir(os.path.join(root, path), hash) - return hash - - -def md5_dir(directory): - return md5_update_from_dir(directory, hashlib.md5()).hexdigest() - - -parser = argparse.ArgumentParser(description='Calculate MD5 hash for given folder') -parser.add_argument('folder') -args = parser.parse_args() - -print(md5_dir(args.folder)[0:4]) diff --git a/.jenkinsci/helpers/platform_tag.py b/.jenkinsci/helpers/platform_tag.py deleted file mode 100644 index 4f309df28e2..00000000000 --- a/.jenkinsci/helpers/platform_tag.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/env/python -# -# Copyright Soramitsu Co., Ltd. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 -# - -# -# Adds prefix (can be os name) to each test report. -# - -import xml.etree.ElementTree as ET -import argparse - -parser = argparse.ArgumentParser(description='Tag test names in a JUnit report') -for arg in ['tag', 'xml_report_file']: - parser.add_argument(arg) -args = parser.parse_args() - -tree = ET.parse(args.xml_report_file) -root = tree.getroot() -for i in root.findall(".//Test/Name"): - i.text = "%s | %s" % (args.tag, i.text) -tree.write(args.xml_report_file) diff --git a/.jenkinsci/helpers/transform_xml.py b/.jenkinsci/helpers/transform_xml.py deleted file mode 100644 index 5189a176fa9..00000000000 --- a/.jenkinsci/helpers/transform_xml.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/env/python -# -# Copyright Soramitsu Co., Ltd. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 -# - -# -# Transforms an XML file using XSLT -# - -import lxml.etree as ET -import argparse - -parser = argparse.ArgumentParser(description='Transform an XML file using XSLT') -for arg in ['xslt_transform_file', 'xml_report_file']: - parser.add_argument(arg) -args = parser.parse_args() - -tree = ET.parse(args.xml_report_file) -xslt = ET.parse(args.xslt_transform_file) -transform = ET.XSLT(xslt) -new_tree = transform(tree) -new_tree.write(args.xml_report_file) diff --git a/.jenkinsci/text-variables.groovy b/.jenkinsci/text-variables.groovy deleted file mode 100644 index c44acb716bf..00000000000 --- a/.jenkinsci/text-variables.groovy +++ /dev/null @@ -1,326 +0,0 @@ -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Text variable for jenkins job description -// - -param_chose_opt = 'Default\nBranch commit\nOn open PR\nCommit in Open PR\nBefore merge to trunk\nNightly build\nPush demo\nCustom command' - -param_descriptions = """ -

- Default - will automatically chose the correct one based on branch name and build number
- Branch commit - Linux/gcc v9; Test: Smoke, Unit;
- On open PR - Linux/gcc v9, MacOS/appleclang, Windows/msvc; Test: All; Coverage; Analysis: cppcheck, sonar, codestyle;
- Commit in Open PR - Same as Branch commit
- Before merge to trunk - Linux/gcc v9 v10, Linux/clang v10, MacOS/appleclang, Windows/msvc; Test: ALL; Coverage; Analysis: cppcheck, sonar,codestyle; useBTF=true
- Nightly build - Linux/gcc v9 v10, Linux/clang v10, MacOS/appleclang, Windows/msvc; Test: ALL; Coverage; Analysis: cppcheck, sonar,codestyle; useBTF=true; sanitize
- Push demo - Build Release and push to hub.docker.com/r/soramitsu/iroha
- Custom command - enter command below, Ex: build_type='Release'; testing=false;
-

-""" - -cmd_description = """ -

List of parameters for Jenkins "Custom command" option:

-
- -
- -

Red - this options require to set additional options, or may conflict with another options 

-""" - -return this diff --git a/.jenkinsci/utils/docker-manifest.groovy b/.jenkinsci/utils/docker-manifest.groovy deleted file mode 100644 index 403febc201f..00000000000 --- a/.jenkinsci/utils/docker-manifest.groovy +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Helpers to work with docker manifest -// - -def manifestSupportEnabled() { - def dockerVersion = sh(script: "docker -v", returnStdout: true).trim() - def experimentalEnabled = sh(script: "grep -i experimental ~/.docker/config.json", returnStatus: true) - return experimentalEnabled == 0 && dockerVersion ==~ /^Docker version 18.*$/ - -} - -def manifestCreate(manifestListName, manifests) { - sh "docker manifest create ${manifestListName} ${manifests.join(' ')}" -} - -def manifestAnnotate(manifestListName, manifestsWithFeatures) { - manifestsWithFeatures.each { - sh """ - docker manifest annotate ${manifestListName} ${it['manifest']} --arch "${it['arch']}" \ - --os "${it['os']}" --os-features "${it['osfeatures'].join(',')}" --variant "${it['variant']}" - """ - } -} - -def manifestPush(manifestListName, dockerRegistryLogin, dockerRegistryPassword) { - sh "docker login -u '${dockerRegistryLogin}' -p '${dockerRegistryPassword}'" - sh "docker manifest push --purge ${manifestListName}" -} - -return this diff --git a/.jenkinsci/utils/docker-pull-or-build.groovy b/.jenkinsci/utils/docker-pull-or-build.groovy deleted file mode 100644 index 9d46b4ffc12..00000000000 --- a/.jenkinsci/utils/docker-pull-or-build.groovy +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// This module helps automatically build new docker develop-build image if Dockerfile changed -// - -def buildOptionsString(options) { - def s = '' - if (options) { - options.each { k, v -> - s += "--build-arg ${k}=${v} " - } - } - return s -} - -def dockerPullOrBuild(imageName, currentDockerfileURL, referenceDockerfileURL, scmVars, environment, forceBuild=false, buildOptions=null) { - def iC - buildOptions = buildOptionsString(buildOptions) - withEnv(environment) { - def utils = load '.jenkinsci/utils/utils.groovy' - sh("docker pull ${env.DOCKER_REGISTRY_BASENAME}:${imageName} || true") - def randDir = sh(script: "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 10", returnStdout: true).trim() - def currentDockerfile = utils.getUrl(currentDockerfileURL, "/tmp/${randDir}/currentDockerfile", true) - def referenceDockerfile = utils.getUrl(referenceDockerfileURL, "/tmp/${randDir}/referenceDockerfile") - // Always check for updates in base image. See https://github.com/moby/moby/issues/31613 - sh ("docker pull \$(grep -ioP '(?<=^from)\\s+\\S+' /tmp/${randDir}/currentDockerfile)") - if (utils.filesDiffer(currentDockerfile, referenceDockerfile) || forceBuild) { - // Dockerfile has been changed compared to reference file - // We cannot rely on the local cache - // because Dockerfile may contain apt-get entries that would try to update - // from invalid (stale) addresses - iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} --no-cache -f ${currentDockerfile} .") - } else { - // Build using cache - iC = docker.build("${env.DOCKER_REGISTRY_BASENAME}:${randDir}-${BUILD_NUMBER}", "${buildOptions} --cache-from ${env.DOCKER_REGISTRY_BASENAME}:${imageName} -f ${currentDockerfile} .") - } - } - return iC -} - -return this diff --git a/.jenkinsci/utils/doxygen.groovy b/.jenkinsci/utils/doxygen.groovy deleted file mode 100644 index 6c6f3208d31..00000000000 --- a/.jenkinsci/utils/doxygen.groovy +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Builds and push Doxygen docks -// - -def doDoxygen() { - sh "doxygen Doxyfile" - archiveArtifacts artifacts: 'docs/doxygen/html/*', allowEmptyArchive: true -} - -return this diff --git a/.jenkinsci/utils/utils.groovy b/.jenkinsci/utils/utils.groovy deleted file mode 100644 index 455e676d88f..00000000000 --- a/.jenkinsci/utils/utils.groovy +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// Small utils that can be used multiple times -// - -def selectedBranchesCoverage(List branches) { - return env.GIT_LOCAL_BRANCH in branches -} - -def ccacheSetup(int maxSize) { - sh """ - ccache --version - ccache --show-stats - ccache --zero-stats - ccache --max-size=${maxSize}G - """ -} - -def dockerPush(dockerImageObj, String imageName) { - docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') { - dockerImageObj.push(imageName) - } -} - -def getUrl(String url, String savePath, boolean createDstDir=false) { - if (createDstDir) { - sh "curl -L -o ${savePath} --create-dirs ${url}" - } - else { - sh "curl -L -o ${savePath} ${url}" - } - return savePath -} - -def filesDiffer(String f1, String f2) { - def diffExitCode = sh(script: "diff -q ${f1} ${f2}", returnStatus: true) - return diffExitCode != 0 -} - -def build_vcpkg(String vcpkg_path, String vcpkg_toolchain_file, boolean forceBuild=false){ - if (!(fileExists(vcpkg_toolchain_file)) || forceBuild) { - print "Building vcpkg toolchain..." - if (isUnix()){ - sh """ - rm -rf /opt/dependencies/${vcpkg_path} - echo "\$(date +%F_%T): ${scmVars.GIT_LOCAL_BRANCH} start build ${vcpkg_path}..." >> /opt/dependencies/vcpkg-map.txt - bash vcpkg/build_iroha_deps.sh '${vcpkg_path}' '${env.WORKSPACE}/vcpkg' - echo "\$(date +%F_%T): ${scmVars.GIT_LOCAL_BRANCH} finish build ${vcpkg_path}" >> /opt/dependencies/vcpkg-map.txt - ls -la ${vcpkg_path} - """ - } else{ - powershell """ - \$env:GIT_REDIRECT_STDERR = '2>&1' - if (Test-Path '${vcpkg_path}' ) { Remove-Item '${vcpkg_path}' -Recurse -Force; } - Add-Content c:\\vcpkg-map.txt "\$(Get-Date): ${scmVars.GIT_LOCAL_BRANCH} start build ${vcpkg_path}..." - .\\.packer\\win\\scripts\\vcpkg.ps1 -vcpkg_path "${vcpkg_path}" -iroha_vcpkg_path "${env.WORKSPACE}\\vcpkg" - Add-Content c:\\vcpkg-map.txt "\$(Get-Date): ${scmVars.GIT_LOCAL_BRANCH} finish build ${vcpkg_path}" - """ - } - } else{ - print "The toolchain '${vcpkg_toolchain_file}' exists!" - } -} - -return this diff --git a/.jenkinsci/utils/vars.groovy b/.jenkinsci/utils/vars.groovy deleted file mode 100644 index d0575ec21fd..00000000000 --- a/.jenkinsci/utils/vars.groovy +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env groovy -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -// -// vars to map compiler versions -// - -def compilerMapping () { - return ['gcc9': ['cxx_compiler':'g++-9', 'cc_compiler':'gcc-9'], - 'gcc10' : ['cxx_compiler':'g++-10', 'cc_compiler':'gcc-10'], - 'clang10': ['cxx_compiler':'clang++-10', 'cc_compiler':'clang-10'], - 'appleclang': ['cxx_compiler':'clang++', 'cc_compiler':'clang'], - ] - } - - -return this diff --git a/.packer/README.md b/.packer/README.md deleted file mode 100644 index 7d9dcd95fb1..00000000000 --- a/.packer/README.md +++ /dev/null @@ -1,21 +0,0 @@ -## Quick Start -``` -cd win/ -packer build -var 'windows_password=' -var 'security_group_id=' -var 'iroha_repo=https://github.com/hyperledger/iroha.git' -var 'iroha_branches=main, support/1.1.x' windows-build-server.json -``` -Where : - -`security_group_id` - any aws security_group_id, what have RDP and WinRM ports open (3389/TCP, 5985 - 5986/TCP,) - -`windows_password` - password for Administrator user which will be created in ami. - -`iroha_repo` - Iroha repository - -`iroha_branches` - branches to use as source for building vcpkg - -## Description -This Packer template generates AWS AMI intended to use as on-demand agent in Jenkins jobs. -It installs Dev tools (e.g git, curl ...). -Any extra packages are left out for the sake of keeping AMI as clean and lightweight as possible. - -See available variables in `windows-build-server.json` diff --git a/.packer/win/files/packages.config b/.packer/win/files/packages.config deleted file mode 100644 index e0a1a9866e2..00000000000 --- a/.packer/win/files/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/.packer/win/scripts/SetUpDevTools.ps1 b/.packer/win/scripts/SetUpDevTools.ps1 deleted file mode 100644 index 4869bf40dda..00000000000 --- a/.packer/win/scripts/SetUpDevTools.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; - -# Install Chocolatey -iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - -# Globally Auto confirm every action -choco feature enable -n allowGlobalConfirmation - -# Install all required dependencies with choco -choco install c:\Windows\Temp\packages.config - -# Make `refreshenv` available right away, by defining the $env:ChocolateyInstall -# variable and importing the Chocolatey profile module. -# Note: Using `. $PROFILE` instead *may* work, but isn't guaranteed to. -$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." -Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - -# Reload environment variables -refreshenv - -# Enable prepared transactions in PostgreSQL -$Env:PGPASSWORD='mysecretpassword'; 'ALTER SYSTEM SET max_prepared_transactions = 100;' | psql -Upostgres - -# Install Python packages -python -m pip install setuptools wheel -python -m pip install grpcio_tools pysha3 iroha==0.0.5.4 lxml diff --git a/.packer/win/scripts/SetUpWinRM.ps1 b/.packer/win/scripts/SetUpWinRM.ps1 deleted file mode 100644 index 6672c809531..00000000000 --- a/.packer/win/scripts/SetUpWinRM.ps1 +++ /dev/null @@ -1,43 +0,0 @@ - -write-output "Running User Data Script" -write-host "(host) Running User Data Script" - -Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction Ignore - -# Don't set this before Set-ExecutionPolicy as it throws an error -$ErrorActionPreference = "stop" - -# Remove HTTP listener -Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse - -Set-Item WSMan:\localhost\MaxTimeoutms 1800000 -Set-Item WSMan:\localhost\Service\Auth\Basic $true - -Enable-PSRemoting -force -Set-Item WSMan:\localhost\Client\trustedhosts -value * -force - -$Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer" -New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Cert.Thumbprint -Force - -# WinRM -write-output "Setting up WinRM" -write-host "(host) setting up WinRM" - -cmd.exe /c winrm quickconfig -q -cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' -cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="0"}' -cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}' -cmd.exe /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}' -cmd.exe /c winrm set "winrm/config/service/auth" '@{Basic="true"}' -cmd.exe /c winrm set "winrm/config/client/auth" '@{Basic="true"}' -#cmd.exe /c winrm set "winrm/config/service/auth" '@{CredSSP="true"}' -cmd.exe /c winrm set "winrm/config/listener?Address=*+Transport=HTTPS" "@{Port=`"5986`";Hostname=`"packer`";CertificateThumbprint=`"$($Cert.Thumbprint)`"}" -cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes -cmd.exe /c netsh firewall add portopening TCP 5986 "Port 5986" -cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" -cmd.exe /c netsh firewall add portopening TCP 445 "Port 445 SMB Jenkins" -Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart -cmd.exe /c net stop winrm -cmd.exe /c sc config winrm start= auto -cmd.exe /c net start winrm - \ No newline at end of file diff --git a/.packer/win/scripts/vcpkg.ps1 b/.packer/win/scripts/vcpkg.ps1 deleted file mode 100644 index 405aa441fbb..00000000000 --- a/.packer/win/scripts/vcpkg.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -param ( - [string]$vcpkg_path = "C:\vcpkg", - [string]$iroha_vcpkg_path = "C:\Windows\Temp\vcpkg" -) - -$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; - -echo "Cloning and setting up vcpkg" -git clone https://github.com/Microsoft/vcpkg.git $vcpkg_path - -echo "Checkout to commit" -git -C $vcpkg_path checkout (Get-Content -Path $iroha_vcpkg_path\VCPKG_COMMIT_SHA) - -echo "Apply patches to vcpkg" -foreach($file in Get-ChildItem $iroha_vcpkg_path\patches -Filter *.patch) { git -C $vcpkg_path apply --ignore-whitespace $file.FullName } - -echo "Run bootstrap-vcpkg.bat" -Invoke-Expression "$vcpkg_path\bootstrap-vcpkg.bat" - -echo "Installing vcpkg packages" -Invoke-Expression "$vcpkg_path\vcpkg.exe install --triplet x64-windows (Get-Content -Path $iroha_vcpkg_path\VCPKG_DEPS_LIST)" -#Invoke-Expression "$vcpkg_path\vcpkg.exe install --triplet x64-windows --head (Get-Content -Path $iroha_vcpkg_path\VCPKG_HEAD_DEPS_LIST)" - -echo "Run vcpkg.exe integrate install" -Invoke-Expression "$vcpkg_path\vcpkg.exe integrate install" diff --git a/.packer/win/scripts/vcpkg_for_multiple_branch.ps1 b/.packer/win/scripts/vcpkg_for_multiple_branch.ps1 deleted file mode 100644 index 3d4b11d25c6..00000000000 --- a/.packer/win/scripts/vcpkg_for_multiple_branch.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -# This script runs vcpkg.ps1 multiple time with different iroha branches -# It is very helpful then you need setup multiple vcpkg on windows build agent, -# for example build main and develop from one ami - -param( - [string] $iroha_repo = "https://github.com/hyperledger/iroha.git", - [array] $branches = "main" -) -$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; - -$tmp_iroha_dir = "C:\Windows\Temp\iroha" - -echo "Cloning Iroha" -git clone $iroha_repo $tmp_iroha_dir - -ForEach ($branch in $branches ) { - echo "Checkout to branch: $branch" - git -C $tmp_iroha_dir checkout $branch - - $vcpkg_path = "c:\vcpkg-$(python C:\Windows\Temp\hash.py $tmp_iroha_dir\vcpkg)" - - if (!(Test-Path $vcpkg_path)) { - # logging - Add-Content c:\\vcpkg-map.txt "\$(Get-Date): $branch start build ${vcpkg_path}..." - - echo "Start vcpkg.ps1 script" - C:\Windows\Temp\scripts\vcpkg.ps1 -vcpkg_path $vcpkg_path -iroha_vcpkg_path "${tmp_iroha_dir}\vcpkg" - - echo "vcpkg.ps1 script finished" - Add-Content c:\\vcpkg-map.txt "\$(Get-Date): $branch finish build ${vcpkg_path}" - } - else { echo "$vcpkg_path already exists" } - -} - -echo "Remove Iroha tmp dir" -Remove-Item $tmp_iroha_dir -Recurse -Force - diff --git a/.packer/win/windows-build-server.json b/.packer/win/windows-build-server.json deleted file mode 100644 index 36cab89846d..00000000000 --- a/.packer/win/windows-build-server.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "variables": { - "aws_access_key": "", - "aws_secret_key": "", - "instance_type": "c5.2xlarge", - "security_group_id": "", - "windows_password": "", - "iroha_repo": "", - "iroha_branches": "" - }, - "builders": [ - { - "force_deregister": true, - "force_delete_snapshot": true, - "type": "amazon-ebs", - "access_key": "{{user `aws_access_key`}}", - "secret_key": "{{user `aws_secret_key`}}", - "region": "eu-west-1", - "instance_type": "{{user `instance_type`}}", - "source_ami_filter": { - "filters": { - "name": "Windows_Server-2019-English-Full-Base-*" - }, - "owners": ["801119661308"], - "most_recent": true - }, - "ami_name": "packer-jenkins-win-slave-iroha", - "security_group_id": "{{user `security_group_id`}}", - "user_data_file": "./scripts/SetUpWinRM.ps1", - "communicator": "winrm", - "winrm_username": "Administrator", - "winrm_use_ssl": true, - "winrm_insecure": true, - "launch_block_device_mappings": [ - { - "device_name": "/dev/sda1", - "volume_size": 240, - "volume_type": "gp2", - "delete_on_termination": true - } - ], - "tags": { - "Name": "ami-packer-jenkins-win-slave-iroha", - "Project": "iroha", - "Environment": "dev", - "Base_AMI_Name": "{{ .SourceAMIName }}" - } - } - ], - "provisioners": [ - { - "type": "file", - "sources": [ - "./files/packages.config", - "../../.jenkinsci/helpers/hash.py", - "./scripts" - ], - "destination": "C:\\Windows\\Temp\\" - }, - { - "type": "powershell", - "scripts": [ - "./scripts/SetUpDevTools.ps1" - ], - "valid_exit_codes": [0, 3010] - }, - { - "type": "windows-restart" - }, - { - "type": "powershell", - "inline": [ - "C:\\Windows\\Temp\\scripts\\vcpkg_for_multiple_branch.ps1 {{user `iroha_repo`}} {{user `iroha_branches`}}", - "dir c:\\" - ] - }, - { - "type": "powershell", - "inline": [ - "$launchConfig = Get-Content -Path C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json | ConvertFrom-Json", - "$launchConfig.adminPasswordType = 'Specify'", - "$launchConfig.adminPassword = '{{user `windows_password`}}'", - "$launchConfig", - "Set-Content -Value ($launchConfig | ConvertTo-Json) -Path C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json" - ] - }, - { - "type": "powershell", - "inline": [ - "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule", - "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1 -NoShutdown" - ] - } - ], "post-processors": [ - { - "type": "manifest" - } - ] -} - diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index afd209738d2..00000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Copyright Soramitsu Co., Ltd. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException - -def tasks = [:] - -class Worker { - String label - int cpusAvailable -} - -class Builder { - // can't get to work without 'static' - static class PostSteps { - List success = [] - List failure = [] - List unstable = [] - List always = [] - List aborted = [] - } - List buildSteps = [] - PostSteps postSteps -} - -class Build { - String name = '' - Builder builder - Worker worker -} - -def build(Build build) { - return { - node(build.worker.label) { - try { - echo "Worker: ${env.NODE_NAME}" - gitNotify ("Jenkins: " + build.name, "Started...", 'PENDING') - build.builder.buildSteps.each { - it() - } - if (currentBuild.currentResult == 'SUCCESS') { - build.builder.postSteps.success.each { - it() - } - } else if(currentBuild.currentResult == 'UNSTABLE') { - build.builder.postSteps.unstable.each { - it() - } - } - } catch(FlowInterruptedException e) { - print "Looks like we ABORTED" - currentBuild.result = 'ABORTED' - build.builder.postSteps.aborted.each { - it() - } - } catch(Exception e) { - print "Error was detected: " + e - currentBuild.result = 'FAILURE' - build.builder.postSteps.failure.each { - it() - } - } - // ALWAYS - finally { - if (currentBuild.currentResult == 'SUCCESS') - gitNotify ("Jenkins: " + build.name, "Finish", 'SUCCESS') - else - gitNotify ("Jenkins: " + build.name, currentBuild.currentResult, 'FAILURE') - - build.builder.postSteps.always.each { - it() - } - } - } - } -} - -def registerBuildSteps(buildSteps, postSteps, String name, worker, tasks){ - builder = new Builder(buildSteps: buildSteps, postSteps: postSteps) - - build_instance = new Build(name: name, builder: builder, worker: worker) - - tasks[build_instance.name] = build(build_instance) -} - -// sanitise the string it should contain only 'key1=value1;key2=value2;...' -def cmd_sanitize(String cmd){ - if (cmd.contains("//")) - return false - - for (i in cmd.split(";")){ - if (i.split("=").size() != 2 ) - return false - for (j in i.split("=")){ - if (j.trim().contains(" ")) - return false - } - } - return true -} - -def gitNotify (context, description, status, targetUrl='' ){ - if (build_scenario != 'Nightly build') { - githubNotify context: context, credentialsId: 'SORABOT_TOKEN_AND_LOGIN', description: description, status: status, targetUrl: targetUrl - } -} - -stage('Prepare environment'){ -timestamps(){ - - -node ('master') { - scmVars = checkout scm - def textVariables = load '.jenkinsci/text-variables.groovy' - properties([ - parameters([ - choice(choices: textVariables.param_chose_opt, description: textVariables.param_descriptions, name: 'build_scenario'), - string(defaultValue: '', description: textVariables.cmd_description, name: 'custom_cmd', trim: true) - ]), - buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')) - ]) - environmentList = [] - environment = [:] - environment = [ - "CCACHE_DEBUG_DIR": "/opt/.ccache", - "CCACHE_RELEASE_DIR": "/opt/.ccache", - "DOCKER_REGISTRY_BASENAME": "hyperledger/iroha", - "IROHA_NETWORK": "iroha-${scmVars.CHANGE_ID}-${scmVars.GIT_COMMIT}-${env.BUILD_NUMBER}", - "IROHA_POSTGRES_HOST": "pg-${scmVars.CHANGE_ID}-${scmVars.GIT_COMMIT}-${env.BUILD_NUMBER}", - "IROHA_POSTGRES_USER": "pguser${scmVars.GIT_COMMIT}", - "IROHA_POSTGRES_PASSWORD": "${scmVars.GIT_COMMIT}", - "IROHA_POSTGRES_PORT": "5432", - "GIT_RAW_BASE_URL": "https://raw.githubusercontent.com/hyperledger/iroha" - ] - - // Define variable and params - - //All variable and Default values - x64linux_compiler_list = ['gcc9'] - mac_compiler_list = [] - win_compiler_list = [] - s390xlinux_compiler_list = [] - - testing = true - testList = '(module)' - fuzzing = true // testing = true - benchmarking = true // testing = true - - sanitize = false - cppcheck = false - coredumps = true - sonar = false - codestyle = false - coverage = false - coverage_mac = false - coverage_s390x = false - doxygen = false - - build_type = 'Debug' - build_shared_libs = false - packageBuild = false - pushDockerTag = 'not-supposed-to-be-pushed' - packagePush = false - specialBranch = false - parallelism = 0 - useBTF = false - use_libursa = false - use_burrow = false - forceDockerDevelopBuild = false - - if (scmVars.GIT_LOCAL_BRANCH in ["main"] || env.TAG_NAME ) - specialBranch = true - else - specialBranch = false - - if (specialBranch){ - // if specialBranch == true the release build will run, so set packagePush - packagePush = true - doxygen = true - // support Ursa and Burrow in release Docker image - use_libursa = true - use_burrow = true - } - - if (scmVars.GIT_LOCAL_BRANCH == "main") - pushDockerTag = 'main' - else if (env.TAG_NAME) - pushDockerTag = env.TAG_NAME - else - pushDockerTag = 'not-supposed-to-be-pushed' - - if (params.build_scenario == 'Default') - if ( scmVars.GIT_BRANCH.startsWith('PR-')) - if (BUILD_NUMBER == '1') - build_scenario='On open PR' - else - build_scenario='Commit in Open PR' - else - build_scenario='Branch commit' - else - build_scenario = params.build_scenario - - - print("Selected Build Scenario '${build_scenario}'") - switch(build_scenario) { - case 'Branch commit': - echo "All Default" - break; - case 'On open PR': - // Just hint, not the main way to Notify about build status. - ///Disable yellow status @kuvaldini @BulatSaif https://github.com/hyperledger/iroha/pull/1028#issuecomment-872080478 - //gitNotify ("Jenkins: Merge to trunk", "Please, run: 'Before merge to trunk'", 'PENDING', env.JOB_URL + "/build") - mac_compiler_list = ['appleclang'] - win_compiler_list = ['msvc'] - testList = '()' - coverage = true - cppcheck = true - sonar = true - codestyle = true - break; - case 'Commit in Open PR': - ///Disable yellow status @kuvaldini @BulatSaif https://github.com/hyperledger/iroha/pull/1028#issuecomment-872080478 - // gitNotify ("Jenkins: Merge to trunk", "Please, run: 'Before merge to trunk'", 'PENDING', env.JOB_URL + "/build") - echo "All Default" - break; - case 'Before merge to trunk': - gitNotify ("Jenkins: Merge to trunk", "Started...", 'PENDING') - x64linux_compiler_list = ['gcc9', 'gcc10', 'clang10'] - s390xlinux_compiler_list = ['gcc9'] - mac_compiler_list = ['appleclang'] - win_compiler_list = ['msvc'] - testing = true - testList = '()' - coverage = true - cppcheck = true - sonar = true - codestyle = true - useBTF = true - break; - case 'Nightly build': - x64linux_compiler_list = ['gcc9', 'gcc10', 'clang10'] - s390xlinux_compiler_list = ['gcc9'] - mac_compiler_list = ['appleclang'] - win_compiler_list = ['msvc'] - testing = true - testList = '()' - coverage = true - cppcheck = true - sonar = true - codestyle = true - useBTF = true - sanitize = true - specialBranch=false - packagePush=false - doxygen=false - break; - case 'Push demo': - build_type='Release' - testing=false - environment["DOCKER_REGISTRY_BASENAME"] = 'soramitsu/iroha' - pushDockerTag = scmVars.GIT_LOCAL_BRANCH.trim().replaceAll('/','-') - packageBuild=true - fuzzing=false - benchmarking=false - coredumps=false - packagePush=true - break; - case 'Custom command': - if (cmd_sanitize(params.custom_cmd)){ - evaluate (params.custom_cmd) - // A very rare scenario when linux compiler is not selected but we still need coverage - if (x64linux_compiler_list.isEmpty() && coverage ){ - coverage_mac = true - } else if (mac_compiler_list.isEmpty() && coverage) { - coverage_s390x = true - } - } else { - println("Unable to parse '${params.custom_cmd}'") - sh "exit 1" - } - break; - default: - println("The value build_scenario='${build_scenario}' is not implemented"); - sh "exit 1" - break; - } - - // convert dictionary to list - environment.each { e -> - environmentList.add("${e.key}=${e.value}") - } - - echo """ - specialBranch=${specialBranch}, packageBuild=${packageBuild}, pushDockerTag=${pushDockerTag}, packagePush=${packagePush} - testing=${testing}, testList=${testList}, parallelism=${parallelism}, useBTF=${useBTF} - x64linux_compiler_list=${x64linux_compiler_list}, mac_compiler_list=${mac_compiler_list}, win_compiler_list = ${win_compiler_list}" - s390xlinux_compiler_list=${s390xlinux_compiler_list}, - sanitize=${sanitize}, cppcheck=${cppcheck}, fuzzing=${fuzzing}, benchmarking=${benchmarking}, coredumps=${coredumps}, sonar=${sonar}, - codestyle=${codestyle},coverage=${coverage}, coverage_mac=${coverage_mac}, coverage_s390x=${coverage_s390x} doxygen=${doxygen}" - forceDockerDevelopBuild=${forceDockerDevelopBuild}, env.TAG_NAME=${env.TAG_NAME} - """ - print scmVars - print environmentList - - - // Load Scripts - def x64LinuxBuildScript = load '.jenkinsci/builders/x64-linux-build-steps.groovy' - def x64BuildScript = load '.jenkinsci/builders/x64-mac-build-steps.groovy' - def x64WinBuildScript = load '.jenkinsci/builders/x64-win-build-steps.groovy' - - // Define Workers - x64LinuxWorker = new Worker(label: 'docker-build-agent', cpusAvailable: 4) - s390xLinuxWorker = new Worker(label: 'linuxone', cpusAvailable: 4) - x64MacWorker = new Worker(label: 'mac', cpusAvailable: 4) - x64WinWorker = new Worker(label: 'windows-iroha-agent', cpusAvailable: 8) - - - // Define all possible steps - def x64LinuxBuildSteps - def x64LinuxPostSteps = new Builder.PostSteps() - if(!x64linux_compiler_list.isEmpty()){ - x64LinuxAlwaysPostSteps = new Builder.PostSteps( - always: [{x64LinuxBuildScript.alwaysPostSteps(scmVars, environmentList, coredumps)}]) - x64LinuxPostSteps = new Builder.PostSteps( - always: [{x64LinuxBuildScript.alwaysPostSteps(scmVars, environmentList, coredumps)}], - success: [{x64LinuxBuildScript.successPostSteps(scmVars, packagePush, pushDockerTag, environmentList)}]) - def first_compiler = x64linux_compiler_list[0] - def default_compiler = 'gcc9' - def release_build = specialBranch && build_type == 'Debug' - def manifest_push = specialBranch && !env.TAG_NAME || forceDockerDevelopBuild - def current_parallelism = parallelism == 0 ? x64LinuxWorker.cpusAvailable : parallelism - - // register first compiler with coverage, analysis, docs, and manifest push - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, first_compiler, build_type, build_shared_libs, specialBranch, coverage, - testing, testList, cppcheck, sonar, codestyle, doxygen, packageBuild, sanitize, fuzzing, benchmarking, coredumps, useBTF, use_libursa, use_burrow, - forceDockerDevelopBuild, manifest_push, environmentList)}], - release_build ? x64LinuxAlwaysPostSteps : x64LinuxPostSteps, "x86_64 Linux ${build_type} ${first_compiler}", x64LinuxWorker, tasks) - if (x64linux_compiler_list.size() > 1){ - x64linux_compiler_list[1..-1].each { compiler -> - // register compiler without coverage, analysis, docs, and manifest push - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, compiler, build_type, build_shared_libs, specialBranch, /*coverage*/false, - testing, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, sanitize, fuzzing, - benchmarking, coredumps, useBTF, use_libursa, use_burrow, /*force_docker_develop_build*/false, /*manifest_push*/false, environmentList)}], - x64LinuxAlwaysPostSteps, "x86_64 Linux ${build_type} ${compiler}", x64LinuxWorker, tasks) - } - } - // If "main" also run Release build - if (release_build){ - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, first_compiler, 'Release', build_shared_libs, specialBranch, /*coverage*/false, - /*testing*/false, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/true, /*sanitize*/false, - /*fuzzing*/false, /*benchmarking*/false, /*coredumps*/false, /*use_btf*/false, use_libursa, use_burrow, /*force_docker_develop_build*/false, - /*manifest_push*/false, environmentList)}], - x64LinuxPostSteps, "x86_64 Linux Release ${first_compiler}", x64LinuxWorker, tasks) - // will not be executed in usual case, because x64linux_compiler_list = ['gcc9'] for main branch or tags - if (x64linux_compiler_list.size() > 1){ - x64linux_compiler_list[1..-1].each { compiler -> - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, compiler, 'Release', build_shared_libs, specialBranch, /*coverage*/false, - /*testing*/false, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, /*sanitize*/false, - /*fuzzing*/false, /*benchmarking*/false, /*coredumps*/false, /*use_btf*/false, use_libursa, use_burrow, /*force_docker_develop_build*/false, - /*manifest_push*/false, environmentList)}], - x64LinuxAlwaysPostSteps, "x86_64 Linux Release ${compiler}", x64LinuxWorker, tasks) - } - } - } - if (build_scenario == 'Before merge to trunk') { - // TODO 2019-08-14 lebdron: IR-600 Fix integration tests execution when built with shared libraries - // toggle shared libraries - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, default_compiler, build_type, !build_shared_libs, /*special_branch*/false, /*coverage*/false, - /*testing*/false, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, /*sanitize*/false, - fuzzing, benchmarking, /*coredumps*/false, useBTF, use_libursa, use_burrow, /*force_docker_develop_build*/false, /*manifest_push*/false, environmentList)}], - x64LinuxAlwaysPostSteps, "x86_64 Linux ${build_type} ${default_compiler} Shared Libraries", x64LinuxWorker, tasks) - - // toggle libursa - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, default_compiler, build_type, build_shared_libs, /*special_branch*/false, /*coverage*/false, - testing, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, /*sanitize*/false, fuzzing, - benchmarking, coredumps, useBTF, !use_libursa, use_burrow, /*force_docker_develop_build*/false, /*manifest_push*/false, environmentList)}], - x64LinuxAlwaysPostSteps, "x86_64 Linux ${build_type} ${default_compiler} Ursa", x64LinuxWorker, tasks) - - // toggle burrow - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, default_compiler, build_type, build_shared_libs, /*special_branch*/false, /*coverage*/false, - testing, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, /*sanitize*/false, fuzzing, - benchmarking, coredumps, useBTF, use_libursa, !use_burrow, /*force_docker_develop_build*/false, /*manifest_push*/false, environmentList)}], - x64LinuxAlwaysPostSteps, "x86_64 Linux ${build_type} ${default_compiler} Burrow", x64LinuxWorker, tasks) - } - } - - def s390xLinuxBuildSteps - def s390xLinuxPostSteps = new Builder.PostSteps() - if(false && !s390xlinux_compiler_list.isEmpty()){ - s390xLinuxAlwaysPostSteps = new Builder.PostSteps( - always: [{x64LinuxBuildScript.alwaysPostSteps(scmVars, environmentList, coredumps)}]) - s390xLinuxPostSteps = new Builder.PostSteps( - always: [{x64LinuxBuildScript.alwaysPostSteps(scmVars, environmentList, coredumps)}], - success: [{x64LinuxBuildScript.successPostSteps(scmVars, packagePush, pushDockerTag, environmentList)}]) - def first_compiler = s390xlinux_compiler_list[0] - def release_build = specialBranch && build_type == 'Debug' - def manifest_push = false - def current_parallelism = parallelism == 0 ? s390xLinuxWorker.cpusAvailable : parallelism - - // register first compiler with packageBuild, and manifest push - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, first_compiler, build_type, build_shared_libs, specialBranch, coverage_s390x, - testing, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, packageBuild, sanitize, fuzzing, benchmarking, - coredumps, useBTF, use_libursa, use_burrow, forceDockerDevelopBuild, manifest_push, environmentList)}], - release_build ? s390xLinuxAlwaysPostSteps : s390xLinuxPostSteps, "s390x Linux ${build_type} ${first_compiler}", s390xLinuxWorker, tasks) - if (s390xlinux_compiler_list.size() > 1){ - s390xlinux_compiler_list[1..-1].each { compiler -> - // register compiler without coverage, analysis, docs, and manifest push - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, compiler, build_type, build_shared_libs, specialBranch, /*coverage_s390x*/false, - testing, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/false, sanitize, fuzzing, - benchmarking, coredumps, useBTF, use_libursa, use_burrow, /*force_docker_develop_build*/false, /*manifest_push*/false, environmentList)}], - s390xLinuxAlwaysPostSteps, "s390x Linux ${build_type} ${compiler}", s390xLinuxWorker, tasks) - } - } - // If "main" also run Release build - if (release_build){ - registerBuildSteps([{x64LinuxBuildScript.buildSteps( - current_parallelism, first_compiler, 'Release', build_shared_libs, specialBranch, /*coverage_s390x*/false, - /*testing*/false, testList, /*cppcheck*/false, /*sonar*/false, /*codestyle*/false, /*doxygen*/false, /*package_build*/true, /*sanitize*/false, - /*fuzzing*/false, /*benchmarking*/false, /*coredumps*/false, /*use_btf*/false, use_libursa, use_burrow, /*force_docker_develop_build*/false, - /*manifest_push*/false, environmentList)}], - x64LinuxPostSteps, "s390x Linux Release ${first_compiler}", s390xLinuxWorker, tasks) - } - } - - def x64MacBuildSteps - def x64MacPostSteps = new Builder.PostSteps() - if (!mac_compiler_list.isEmpty()) { - x64MacAlwaysPostSteps = new Builder.PostSteps( - always: [{x64BuildScript.alwaysPostSteps(environmentList)}]) - x64MacPostSteps = new Builder.PostSteps( - always: [{x64BuildScript.alwaysPostSteps(environmentList)}], - success: [{x64BuildScript.successPostSteps(scmVars, packagePush, environmentList)}]) - def release_build = specialBranch && build_type == 'Debug' - def current_parallelism = parallelism == 0 ? x64MacWorker.cpusAvailable : parallelism - - registerBuildSteps([{x64BuildScript.buildSteps(current_parallelism, - mac_compiler_list, build_type, coverage_mac, testing, testList, packageBuild, fuzzing, benchmarking, useBTF, use_libursa, use_burrow, environmentList)}], - release_build ? x64MacAlwaysPostSteps : x64MacPostSteps, "Mac ${build_type}", x64MacWorker, tasks) - - //If "main" also run Release build - if (release_build) { - registerBuildSteps([{x64BuildScript.buildSteps(current_parallelism, - mac_compiler_list, 'Release', /*coverage_mac*/false, /*testing*/false, testList, /*packageBuild*/true, /*fuzzing*/false, /*benchmarking*/false, /*use_btf*/false, - use_libursa, use_burrow, environmentList)}], - x64MacPostSteps, "Mac Release ${build_type}", x64MacWorker, tasks) - } - if (build_scenario == 'Before merge to trunk') { - // toggle libursa - registerBuildSteps([{x64BuildScript.buildSteps(current_parallelism, - mac_compiler_list, build_type, /*coverage_mac*/false, testing, testList, packageBuild, fuzzing, benchmarking, useBTF, !use_libursa, use_burrow, environmentList)}], - x64MacAlwaysPostSteps, "Mac ${build_type} Ursa", x64MacWorker, tasks) - - // toggle burrow - registerBuildSteps([{x64BuildScript.buildSteps(current_parallelism, - mac_compiler_list, build_type, /*coverage_mac*/false, testing, testList, packageBuild, fuzzing, benchmarking, useBTF, use_libursa, !use_burrow, environmentList)}], - x64MacAlwaysPostSteps, "Mac ${build_type} Burrow", x64MacWorker, tasks) - } - } - - def x64WinBuildSteps - def x64WinBuildPostSteps = new Builder.PostSteps() - def x64WinEnvironmentList = environmentList.clone() - // Windows workers use localhost PostgreSQL deployment with default settings - x64WinEnvironmentList.removeAll { it.contains("IROHA_POSTGRES") } - print x64WinEnvironmentList - if(!win_compiler_list.isEmpty()){ - x64WinBuildSteps = [{x64WinBuildScript.buildSteps(parallelism==0 ?x64WinWorker.cpusAvailable : parallelism, - win_compiler_list, build_type, /*coverage*/false, testing, testList, packageBuild, benchmarking, useBTF, x64WinEnvironmentList)}] - x64WinBuildPostSteps = new Builder.PostSteps( - always: [{x64WinBuildScript.alwaysPostSteps(x64WinEnvironmentList)}], - success: [{x64WinBuildScript.successPostSteps(scmVars, packagePush, x64WinEnvironmentList)}]) - } - - if(!win_compiler_list.isEmpty()){ - registerBuildSteps(x64WinBuildSteps, x64WinBuildPostSteps, "Windows ${build_type}", x64WinWorker, tasks) - } - - cleanWs() - parallel tasks - - if(codestyle){ - report_file = "${BUILD_URL}artifact/clang-format-report.txt" - line = sh(script: "curl -s ${report_file} | wc -l", returnStdout: true).trim().toInteger() - if ( line == 1 ) - gitNotify ("Jenkins: ClangFormat", "SUCCESS", 'SUCCESS', report_file ) - else - gitNotify ("Jenkins: ClangFormat", "You need to format ~ ${line/2} lines", 'FAILURE', report_file ) - } - if (build_scenario == 'Before merge to trunk') - if (currentBuild.currentResult == 'SUCCESS') - gitNotify ("Jenkins: Merge to trunk", "Finish", 'SUCCESS') - else - gitNotify ("Jenkins: Merge to trunk", currentBuild.currentResult, 'FAILURE') -} - -} -} diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 49e8b9bde4d..a983a152c3c 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -26,5 +26,5 @@ This is the list of maintainers, including their email address for direct commun | Vyacheslav Bikbaev | @laSinteZ | viacheslav@soramitsu.co.jp | Documentation, NodeJS library | | Arseniy Fokin | @stinger112 | stinger112@gmail.com | NodeJS library | | Alexey Chernyshov | @Alexey-N-Chernyshov | chernyshov@soramitsu.co.jp | Development | -| Artyom Bakhtin | @bakhtin | a@bakhtin.net | Ansible, Jenkins, artifacts | -| Anatoly Tyukushin | @tyvision | tyukushin@soramitsu.co.jp | Ansible, Jenkins | +| Artyom Bakhtin | @bakhtin | a@bakhtin.net | Ansible, artifacts | +| Anatoly Tyukushin | @tyvision | tyukushin@soramitsu.co.jp | Ansible | diff --git a/README.md b/README.md index 6e0c18ed366..be3d92d055a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/960/badge)](https://bestpractices.coreinfrastructure.org/projects/960) -[![Build Status](https://jenkins.soramitsu.co.jp/buildStatus/icon?job=iroha/iroha-hyperledger/main)](https://jenkins.soramitsu.co.jp/job/iroha/job/iroha-hyperledger/job/main/) Iroha is a straightforward distributed ledger technology (DLT), inspired by Japanese Kaizen principle — eliminate excessiveness (muri). Iroha has essential functionality for your asset, information and identity management needs, at the same time being an efficient and trustworthy crash fault-tolerant tool for your enterprise needs.