Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 60075d0

Browse files
authored
Merge pull request #1494 from hyperledger/develop
Hyperledger Iroha v1.0.0_beta-3
2 parents af16446 + 3608e4b commit 60075d0

File tree

585 files changed

+17361
-6822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

585 files changed

+17361
-6822
lines changed

.jenkinsci/artifacts.groovy

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,30 @@ def uploadArtifacts(filePaths, uploadPath, artifactServers=['artifact.soramitsu.
1111
}
1212
def shaSumBinary = 'sha256sum'
1313
def md5SumBinary = 'md5sum'
14+
def gpgKeyBinary = 'gpg --armor --detach-sign --no-tty --batch --yes --passphrase-fd 0'
1415
if (agentType == 'Darwin') {
1516
shaSumBinary = 'shasum -a 256'
1617
md5SumBinary = 'md5 -r'
18+
gpgKeyBinary = 'GPG_TTY=\$(tty) gpg --pinentry-mode loopback --armor --detach-sign --no-tty --batch --yes --passphrase-fd 0'
1719
}
1820
sh "> \$(pwd)/batch.txt"
19-
filePathsConverted.each {
20-
sh "echo put ${it} $uploadPath >> \$(pwd)/batch.txt;"
21-
sh "$shaSumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).sha256"
22-
sh "$md5SumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).md5"
23-
sh "echo put \$(pwd)/\$(basename ${it}).sha256 $uploadPath >> \$(pwd)/batch.txt;"
24-
sh "echo put \$(pwd)/\$(basename ${it}).md5 $uploadPath >> \$(pwd)/batch.txt;"
21+
22+
withCredentials([file(credentialsId: 'ci_gpg_privkey', variable: 'CI_GPG_PRIVKEY'), string(credentialsId: 'ci_gpg_masterkey', variable: 'CI_GPG_MASTERKEY')]) {
23+
if (!agentType.contains('MSYS_NT')) {
24+
sh "gpg --yes --batch --no-tty --import ${CI_GPG_PRIVKEY} || true"
25+
}
26+
filePathsConverted.each {
27+
sh "echo put ${it} $uploadPath >> \$(pwd)/batch.txt;"
28+
sh "$shaSumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).sha256"
29+
sh "$md5SumBinary ${it} | cut -d' ' -f1 > \$(pwd)/\$(basename ${it}).md5"
30+
// TODO @bakhtin 30.05.18 IR-1384. Make gpg command options and paths compatible with Windows OS.
31+
if (!agentType.contains('MSYS_NT')) {
32+
sh "echo \"${CI_GPG_MASTERKEY}\" | $gpgKeyBinary -o \$(pwd)/\$(basename ${it}).asc ${it}"
33+
sh "echo put \$(pwd)/\$(basename ${it}).asc $uploadPath >> \$(pwd)/batch.txt;"
34+
}
35+
sh "echo put \$(pwd)/\$(basename ${it}).sha256 $uploadPath >> \$(pwd)/batch.txt;"
36+
sh "echo put \$(pwd)/\$(basename ${it}).md5 $uploadPath >> \$(pwd)/batch.txt;"
37+
}
2538
}
2639
// mkdirs recursively
2740
uploadPath = uploadPath.split('/')
@@ -35,10 +48,11 @@ def uploadArtifacts(filePaths, uploadPath, artifactServers=['artifact.soramitsu.
3548
sshagent(['jenkins-artifact']) {
3649
sh "ssh-agent"
3750
artifactServers.each {
38-
sh "sftp -b \$(pwd)/mkdirs.txt jenkins@${it} || true"
39-
sh "sftp -b \$(pwd)/batch.txt jenkins@${it}"
51+
sh "sftp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -b \$(pwd)/mkdirs.txt jenkins@${it} || true"
52+
sh "sftp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -b \$(pwd)/batch.txt jenkins@${it}"
4053
}
4154
}
4255
}
4356

4457
return this
58+

.jenkinsci/bindings.groovy

Lines changed: 82 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,116 @@
11
#!/usr/bin/env groovy
22

3-
def doJavaBindings(buildType=Release) {
3+
def doJavaBindings(os, buildType=Release) {
44
def currentPath = sh(script: "pwd", returnStdout: true).trim()
55
def commit = env.GIT_COMMIT
6-
def artifactsPath = sprintf('%1$s/java-bindings-%2$s-%3$s-%4$s.zip',
7-
[currentPath, buildType, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])
6+
def artifactsPath = sprintf('%1$s/java-bindings-%2$s-%3$s-%4$s-%5$s.zip',
7+
[currentPath, buildType, os, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])
8+
def cmakeOptions = ""
9+
if (os == 'windows') {
10+
sh "mkdir -p /tmp/${env.GIT_COMMIT}/bindings-artifact"
11+
cmakeOptions = '-DCMAKE_TOOLCHAIN_FILE=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/scripts/buildsystems/vcpkg.cmake -G "NMake Makefiles"'
12+
}
13+
if (os == 'linux') {
14+
// do not use preinstalled libed25519
15+
sh "rm -rf /usr/local/include/ed25519*; unlink /usr/local/lib/libed25519.so; rm -f /usr/local/lib/libed25519.so.1.2.2"
16+
}
817
sh """
918
cmake \
10-
-H. \
19+
-Hshared_model \
1120
-Bbuild \
1221
-DCMAKE_BUILD_TYPE=$buildType \
13-
-DSWIG_JAVA=ON
22+
-DSWIG_JAVA=ON \
23+
${cmakeOptions}
1424
"""
15-
sh "cd build; make -j${params.PARALLELISM} irohajava"
16-
sh "zip -j $artifactsPath build/shared_model/bindings/*.java build/shared_model/bindings/libirohajava.so"
17-
sh "cp $artifactsPath /tmp/bindings-artifact"
25+
def parallelismParam = (os == 'windows') ? '' : "-j${params.PARALLELISM}"
26+
sh "cmake --build build --target irohajava -- ${parallelismParam}"
27+
// TODO 29.05.18 @bakhtin Java tests never finishes on Windows Server 2016. IR-1380
28+
sh "zip -j $artifactsPath build/bindings/*.java build/bindings/*.dll build/bindings/libirohajava.so"
29+
if (os == 'windows') {
30+
sh "cp $artifactsPath /tmp/${env.GIT_COMMIT}/bindings-artifact"
31+
}
32+
else {
33+
sh "cp $artifactsPath /tmp/bindings-artifact"
34+
}
1835
return artifactsPath
1936
}
2037

21-
def doPythonBindings(buildType=Release) {
38+
def doPythonBindings(os, buildType=Release) {
2239
def currentPath = sh(script: "pwd", returnStdout: true).trim()
2340
def commit = env.GIT_COMMIT
2441
def supportPython2 = "OFF"
25-
def artifactsPath = sprintf('%1$s/python-bindings-%2$s-%3$s-%4$s-%5$s.zip',
26-
[currentPath, env.PBVersion, buildType, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])
27-
// do not use preinstalled libed25519
28-
sh "rm -rf /usr/local/include/ed25519*; unlink /usr/local/lib/libed25519.so; rm -f /usr/local/lib/libed25519.so.1.2.2"
42+
def artifactsPath = sprintf('%1$s/python-bindings-%2$s-%3$s-%4$s-%5$s-%6$s.zip',
43+
[currentPath, env.PBVersion, buildType, os, sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])
44+
def cmakeOptions = ""
45+
if (os == 'windows') {
46+
sh "mkdir -p /tmp/${env.GIT_COMMIT}/bindings-artifact"
47+
cmakeOptions = '-DCMAKE_TOOLCHAIN_FILE=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/scripts/buildsystems/vcpkg.cmake -G "NMake Makefiles"'
48+
}
49+
if (os == 'linux') {
50+
// do not use preinstalled libed25519
51+
sh "rm -rf /usr/local/include/ed25519*; unlink /usr/local/lib/libed25519.so; rm -f /usr/local/lib/libed25519.so.1.2.2"
52+
}
2953
if (env.PBVersion == "python2") { supportPython2 = "ON" }
3054
sh """
3155
cmake \
32-
-H. \
56+
-Hshared_model \
3357
-Bbuild \
3458
-DCMAKE_BUILD_TYPE=$buildType \
3559
-DSWIG_PYTHON=ON \
36-
-DSUPPORT_PYTHON2=$supportPython2
60+
-DSUPPORT_PYTHON2=$supportPython2 \
61+
${cmakeOptions}
3762
"""
63+
def parallelismParam = (os == 'windows') ? '' : "-j${params.PARALLELISM}"
64+
sh "cmake --build build --target irohapy -- ${parallelismParam}"
3865
sh "cmake --build build --target python_tests"
39-
sh "cd build; make -j${params.PARALLELISM} irohapy"
40-
sh "protoc --proto_path=schema --python_out=build/shared_model/bindings block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto"
41-
sh "${env.PBVersion} -m grpc_tools.protoc --proto_path=schema --python_out=build/shared_model/bindings --grpc_python_out=build/shared_model/bindings endpoint.proto yac.proto ordering.proto loader.proto"
42-
sh "zip -j $artifactsPath build/shared_model/bindings/*.py build/shared_model/bindings/*.so"
43-
sh "cp $artifactsPath /tmp/bindings-artifact"
66+
sh "cd build; ctest -R python --output-on-failure"
67+
if (os == 'linux') {
68+
sh """
69+
protoc --proto_path=schema \
70+
--python_out=build/bindings \
71+
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
72+
"""
73+
sh """
74+
${env.PBVersion} -m grpc_tools.protoc --proto_path=schema --python_out=build/bindings \
75+
--grpc_python_out=build/bindings endpoint.proto yac.proto ordering.proto loader.proto
76+
"""
77+
}
78+
else if (os == 'windows') {
79+
sh """
80+
protoc --proto_path=schema \
81+
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
82+
--python_out=build/bindings \
83+
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
84+
"""
85+
sh """
86+
${env.PBVersion} -m grpc_tools.protoc \
87+
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
88+
--proto_path=schema --python_out=build/bindings --grpc_python_out=build/bindings \
89+
endpoint.proto yac.proto ordering.proto loader.proto
90+
"""
91+
}
92+
sh """
93+
zip -j $artifactsPath build/bindings/*.py build/bindings/*.dll build/bindings/*.so \
94+
build/bindings/*.py build/bindings/*.pyd build/bindings/*.lib build/bindings/*.dll \
95+
build/bindings/*.exp build/bindings/*.manifest
96+
"""
97+
if (os == 'windows') {
98+
sh "cp $artifactsPath /tmp/${env.GIT_COMMIT}/bindings-artifact"
99+
}
100+
else {
101+
sh "cp $artifactsPath /tmp/bindings-artifact"
102+
}
44103
return artifactsPath
45104
}
46105

47106
def doAndroidBindings(abiVersion) {
48107
def currentPath = sh(script: "pwd", returnStdout: true).trim()
49108
def commit = env.GIT_COMMIT
50-
def artifactsPath = sprintf('%1$s/android-bindings-%2$s-%3$s-%4$s-%5$s-%6$s.zip',
109+
def artifactsPath = sprintf('%1$s/android-bindings-%2$s-%3$s-%4$s-%5$s-%6$s.zip',
51110
[currentPath, "\$PLATFORM", abiVersion, "\$BUILD_TYPE_A", sh(script: 'date "+%Y%m%d"', returnStdout: true).trim(), commit.substring(0,6)])
52111
sh """
53112
(cd /iroha; git init; git remote add origin https://github.com/hyperledger/iroha.git; \
54-
git fetch --depth 1 origin develop; git checkout -t origin/develop)
113+
git fetch origin ${GIT_COMMIT}; git checkout FETCH_HEAD)
55114
"""
56115
sh """
57116
. /entrypoint.sh; \
@@ -63,7 +122,7 @@ def doAndroidBindings(abiVersion) {
63122
sed -i.bak "s~find_program(protoc_EXECUTABLE protoc~set(protoc_EXECUTABLE \"/protobuf/host_build/protoc\"~" /iroha/cmake/Modules/Findprotobuf.cmake; \
64123
cmake -H/iroha/shared_model -B/iroha/shared_model/build -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=$abiVersion -DCMAKE_ANDROID_ARCH_ABI=\$PLATFORM \
65124
-DANDROID_NDK=\$NDK_PATH -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=\$BUILD_TYPE_A -DTESTING=OFF \
66-
-DSHARED_MODEL_DISABLE_COMPATIBILITY=ON -DSWIG_JAVA=ON -DCMAKE_PREFIX_PATH=\$DEPS_DIR
125+
-DSWIG_JAVA=ON -DCMAKE_PREFIX_PATH=\$DEPS_DIR
67126
"""
68127
sh "cmake --build /iroha/shared_model/build --target irohajava -- -j${params.PARALLELISM}"
69128
sh "zip -j $artifactsPath /iroha/shared_model/build/bindings/*.java /iroha/shared_model/build/bindings/libirohajava.so"

.jenkinsci/cancel-nightly-except-develop.groovy

Lines changed: 0 additions & 15 deletions
This file was deleted.

.jenkinsci/debug-build.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def doDebugBuild(coverageEnabled=false) {
99
def previousCommit = pCommit.previousCommitOrCurrent()
1010
// params are always null unless job is started
1111
// this is the case for the FIRST build only.
12-
// So just set this to same value as default.
12+
// So just set this to same value as default.
1313
// This is a known bug. See https://issues.jenkins-ci.org/browse/JENKINS-41929
1414
if (!parallelism) {
1515
parallelism = 4
@@ -25,9 +25,9 @@ def doDebugBuild(coverageEnabled=false) {
2525
['PARALLELISM': parallelism])
2626

2727
if (GIT_LOCAL_BRANCH == 'develop' && manifest.manifestSupportEnabled()) {
28-
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop-build",
29-
["${DOCKER_REGISTRY_BASENAME}:x86_64-develop-build",
30-
"${DOCKER_REGISTRY_BASENAME}:armv7l-develop-build",
28+
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop-build",
29+
["${DOCKER_REGISTRY_BASENAME}:x86_64-develop-build",
30+
"${DOCKER_REGISTRY_BASENAME}:armv7l-develop-build",
3131
"${DOCKER_REGISTRY_BASENAME}:aarch64-develop-build"])
3232
manifest.manifestAnnotate("${DOCKER_REGISTRY_BASENAME}:develop-build",
3333
[
@@ -70,7 +70,7 @@ def doDebugBuild(coverageEnabled=false) {
7070
ccache --show-stats
7171
ccache --zero-stats
7272
ccache --max-size=5G
73-
"""
73+
"""
7474
sh """
7575
cmake \
7676
-DTESTING=ON \
@@ -85,7 +85,7 @@ def doDebugBuild(coverageEnabled=false) {
8585
if ( coverageEnabled ) {
8686
sh "cmake --build build --target coverage.init.info"
8787
}
88-
def testExitCode = sh(script: 'CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test', returnStatus: true)
88+
def testExitCode = sh(script: """cd build && ctest --output-on-failure""", returnStatus: true)
8989
if (testExitCode != 0) {
9090
currentBuild.result = "UNSTABLE"
9191
}

.jenkinsci/docker-cleanup.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
def doDockerCleanup() {
44

55
sh """
6-
docker rm -f $IROHA_POSTGRES_HOST || true
76
# Check whether the image is the last-standing man
87
# i.e., no other tags exist for this image
98
docker rmi \$(docker images --no-trunc --format '{{.Repository}}:{{.Tag}}\\t{{.ID}}' | grep \$(docker images --no-trunc --format '{{.ID}}' ${iC.id}) | head -n -1 | cut -f 1) || true

.jenkinsci/doxygen.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env groovy
22

33
def doDoxygen() {
4-
4+
55
sh """
66
doxygen Doxyfile
77
#rsync docs/doxygen

.jenkinsci/linux-post-step.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ def linuxPostStep() {
1010
}
1111
}
1212
finally {
13-
if (env.BUILD_TYPE == 'Debug') {
14-
def cleanup = load ".jenkinsci/docker-cleanup.groovy"
15-
cleanup.doDockerCleanup()
16-
}
13+
def cleanup = load ".jenkinsci/docker-cleanup.groovy"
14+
cleanup.doDockerCleanup()
1715
cleanWs()
1816
}
1917
}

.jenkinsci/mac-release-build.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def doReleaseBuild(coverageEnabled=false) {
1919
-DPACKAGE_TGZ=ON \
2020
-DCMAKE_BUILD_TYPE=Release \
2121
-DIROHA_VERSION=${env.IROHA_VERSION}
22-
22+
2323
cmake --build build --target package -- -j${params.PARALLELISM}
2424
mv ./build/iroha-${env.IROHA_VERSION}-*.tar.gz ./build/iroha.tar.gz
2525
ccache --show-stats

0 commit comments

Comments
 (0)