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 @@
-
-
-
- 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;
-
<option_name> = <default_value> [(or <second_default_value> if <git branch name>)]
-<descriptions>
-Ex: <Example of Use>
-x64linux_compiler_list = ['gcc9']
-Linux compiler name to build
-Ex: x64linux_compiler_list = ['gcc9', 'gcc10', 'clang10']
-s390xlinux_compiler_list = []
-Linux (IBMZ s390x) compiler name to build
-Ex: s390xlinux_compiler_list=['gcc9']
-mac_compiler_list = [ ]
-Mac compiler name to build
-Ex: mac_compiler_list = ['appleclang']
-win_compiler_list = [ ]
-Windows compiler name to build
-Ex: win_compiler_list = ['msvc']
-parallelism = 0
-Build in parallel. 0 is choose default: 8 for Linux and 4 for Mac
-testing = true
-Run test for each selected compiler, in jenkins will be several reports
-testList = '(module)'
-Test Regex name
-Ex: `testList = '()'`-All, `testList = '(module|integration|system|cmake|regression|benchmark|framework)'`
-sanitize = false
-Adds cmakeOptions -DSANITIZE='address;leak'
-Ex: sanitize=true;
-cppcheck = false
-Runs cppcheck
-Ex: cppcheck = true
-codestyle = false
-Runs clang-format against changed file in PR
-Ex: codestyle = true
-fuzzing = true
-builds fuzzing tests
-Ex: fuzzing=true; testing = true; testList = "(None)"
-benchmarking = true
-builds benchmarks
-Ex: benchmarking=true; testing = true; testList = "(None)"
-coredumps = true
-Collects coredumps for integration tets (linux only)
-Ex: coredumps=true
-sonar = false
-Runs Sonar Analysis, runs only on Linux
-Ex: sonar = true;x64linux_compiler_list= ['gcc9', 'gcc10']
-coverage = false
-Runs coverage, will run only if testing = true
-Ex: coverage = true
-doxygen = false (or = true if main )
-Build doxygen, docs will be uploaded to jenkins,
-Ex: doxygen=true
-build_type = 'Debug'
-Sets -DCMAKE_BUILD_TYPE=Debug
-Ex: build_type = 'Release';packageBuild = true;testing=false
-build_shared_libs = false
-builds libraries as shared libraries
-Ex: build_shared_libs = true; testList = '()'
-packageBuild = false
-Build package Work only with build_type = 'Release' and testing=false
-Ex: packageBuild = true;build_type = 'Release';testing=false
-pushDockerTag = 'not-supposed-to-be-pushed'(or = main if main)
-if packagePush=true it the name of docker tag that will be pushed
-Ex: packageBuild = true;build_type = 'Release';testing=false;packagePush=true
-packagePush = false (or = true if main )
-push all packages and docker to the artifactory and docker hub
-Ex:packagePush=true;packageBuild = true;build_type = 'Release';testing=false
-useBTF = false
-Sets -DUSE_BTF=ON for cmake configuration
-Ex:useBTF=true
-use_libursa = false
-use Hyperledger Ursa-provided ed25519 with SHA-2 instead of iroha-ed25519 with SHA-3
-Ex:use_libursa=true
-use_burrow = false
-use Hyperledger Burrow Etherium Virtual Machine integration
-Ex:use_burrow=true
-forceDockerDevelopBuild = false
-Builds and push hyperledger/iroha:develop-build
-Ex: forceDockerDevelopBuild=true
-specialBranch = false (or = true if main ),
-Not recommended to set, it used to decide push doxygen and iroha:develop-build or not, and force to run build_type = 'Release'
-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=