Skip to content

Commit ca24ef8

Browse files
AsadManzoorAsadManzoor
AsadManzoor
authored and
AsadManzoor
committed
Hyperledger Fabric Blockchain Implementation
1 parent 8e9b6df commit ca24ef8

File tree

570 files changed

+67082
-0
lines changed

Some content is hidden

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

570 files changed

+67082
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Emacs backup files
2+
*~
3+
*#
4+
.#*
5+
# Vim file artifacts
6+
.*.sw*
7+
# installed platform-specific binaries
8+
/bin
9+
/config
10+
.DS_Store
11+
.project
12+
.idea/
13+
.vscode/

.gitreview

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
[gerrit]
3+
host=gerrit.hyperledger.org
4+
port=29418
5+
project=fabric-samples

CODE_OF_CONDUCT.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Code of Conduct Guidelines
2+
==========================
3+
4+
Please review the Hyperledger [Code of
5+
Conduct](https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct)
6+
before participating. It is important that we keep things civil.
7+
8+
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Contributing
2+
3+
We welcome contributions to the Hyperledger Fabric Project in many forms, and
4+
there's always plenty to do!
5+
6+
Please visit the
7+
[contributors guide](http://hyperledger-fabric.readthedocs.io/en/latest/CONTRIBUTING.html) in the
8+
docs to learn how to make contributions to this exciting project.
9+
10+
## Code of Conduct Guidelines <a name="conduct"></a>
11+
12+
See our [Code of Conduct Guidelines](./CODE_OF_CONDUCT.md).
13+
14+
## Maintainers <a name="maintainers"></a>
15+
16+
Should you have any questions or concerns, please reach out to one of the project's [Maintainers](./MAINTAINERS.md).
17+
18+
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

Hyperleder Term Project.pptx

148 KB
Binary file not shown.

Jenkinsfile

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
#!groovy
2+
// Copyright IBM Corp All Rights Reserved
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
7+
// Jenkinfile will get triggered on verify and merge jobs and run byfn, eyfn and fabcar
8+
// tests.
9+
10+
// global shared library from ci-management repository
11+
// https://github.com/hyperledger/ci-management/tree/master/vars (Global Shared scripts)
12+
@Library("fabric-ci-lib") _
13+
pipeline {
14+
agent {
15+
// Execute tests on x86_64 build nodes
16+
// Set this value from Jenkins Job Configuration
17+
label env.NODE_ARCH
18+
}
19+
options {
20+
// Using the Timestamper plugin we can add timestamps to the console log
21+
timestamps()
22+
// Set build timeout for 60 mins
23+
timeout(time: 60, unit: 'MINUTES')
24+
}
25+
environment {
26+
ROOTDIR = pwd()
27+
// Applicable only on x86_64 nodes
28+
// LF team has to install the newer version in Jenkins global config
29+
// Send an email to [email protected] to add newer version
30+
nodeHome = tool 'nodejs-8.11.3'
31+
MARCH = sh(returnStdout: true, script: "uname -m | sed 's/x86_64/amd64/g'").trim()
32+
OS_NAME = sh(returnStdout: true, script: "uname -s|tr '[:upper:]' '[:lower:]'").trim()
33+
props = "null"
34+
}
35+
stages {
36+
stage('Clean Environment') {
37+
steps {
38+
script {
39+
// delete working directory
40+
deleteDir()
41+
// Clean build env before start the build
42+
fabBuildLibrary.cleanupEnv()
43+
// Display jenkins environment details
44+
fabBuildLibrary.envOutput()
45+
}
46+
}
47+
}
48+
stage('Checkout SCM') {
49+
steps {
50+
script {
51+
// Get changes from gerrit
52+
fabBuildLibrary.cloneRefSpec('fabric-samples')
53+
// Load properties from ci.properties file
54+
props = fabBuildLibrary.loadProperties()
55+
}
56+
}
57+
}
58+
// Pull build artifacts
59+
stage('Pull Build Artifacts') {
60+
steps {
61+
script {
62+
if(props["IMAGE_SOURCE"] == "build") {
63+
println "BUILD ARTIFACTS"
64+
// Set PATH
65+
env.GOPATH = "$WORKSPACE/gopath"
66+
env.GOROOT = "/opt/go/go" + props["GO_VER"] + ".linux." + "$MARCH"
67+
env.PATH = "$GOPATH/bin:$GOROOT/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:${nodeHome}/bin:$PATH"
68+
// Clone fabric repo
69+
fabBuildLibrary.cloneScm('fabric', '$GERRIT_BRANCH')
70+
// Build fabric docker images and binaries
71+
fabBuildLibrary.fabBuildImages('fabric', 'docker dist')
72+
// Clone fabric-ca repo
73+
fabBuildLibrary.cloneScm('fabric-ca', '$GERRIT_BRANCH')
74+
// Build fabric docker images and binaries
75+
fabBuildLibrary.fabBuildImages('fabric-ca', 'docker dist')
76+
// Copy binaries to fabric-samples dir
77+
sh 'cp -r $ROOTDIR/gopath/src/github.com/hyperledger/fabric/release/$OS_NAME-$MARCH/bin $ROOTDIR/$BASE_DIR/'
78+
// Pull Thirdparty Docker Images from hyperledger DockerHub
79+
fabBuildLibrary.pullThirdPartyImages(props["FAB_BASEIMAGE_VERSION"], props["FAB_THIRDPARTY_IMAGES_LIST"])
80+
} else {
81+
dir("$ROOTDIR/$BASE_DIR") {
82+
// Set PATH
83+
env.GOPATH = "$WORKSPACE/gopath"
84+
env.GOROOT = "/opt/go/go" + props["GO_VER"] + ".linux." + "$MARCH"
85+
env.PATH = "$GOPATH/bin:$GOROOT/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:${nodeHome}/bin:$PATH"
86+
// Pull Binaries with latest version from nexus2
87+
fabBuildLibrary.pullBinaries(props["FAB_BINARY_VER"], props["FAB_BINARY_REPO"])
88+
// Pull Docker Images from nexus3
89+
fabBuildLibrary.pullDockerImages(props["FAB_BASE_VERSION"], props["FAB_IMAGES_LIST"])
90+
// Pull Thirdparty Docker Images from hyperledger DockerHub
91+
fabBuildLibrary.pullThirdPartyImages(props["FAB_BASEIMAGE_VERSION"], props["FAB_THIRDPARTY_IMAGES_LIST"])
92+
}
93+
}
94+
}
95+
}
96+
}
97+
// Run byfn, eyfn tests (default, custom channel, couchdb, nodejs, java chaincode)
98+
stage('Run byfn_eyfn Tests') {
99+
steps {
100+
script {
101+
// making the output color coded
102+
// wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
103+
try {
104+
dir("$ROOTDIR/$BASE_DIR/scripts/ci_scripts") {
105+
// Run BYFN, EYFN tests
106+
sh './ciScript.sh --byfn_eyfn_Tests'
107+
}
108+
}
109+
catch (err) {
110+
failure_stage = "byfn_eyfn_Tests"
111+
currentBuild.result = 'FAILURE'
112+
throw err
113+
}
114+
// }
115+
}
116+
}
117+
}
118+
// Run fabcar tests
119+
stage('Run Fab Car Tests') {
120+
steps {
121+
script {
122+
// making the output color coded
123+
// wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
124+
try {
125+
dir("$ROOTDIR/$BASE_DIR/scripts/ci_scripts") {
126+
// Run fabcar tests
127+
sh './ciScript.sh --fabcar_Tests'
128+
}
129+
}
130+
catch (err) {
131+
failure_stage = "fabcar_Tests"
132+
currentBuild.result = 'FAILURE'
133+
throw err
134+
}
135+
// }
136+
}
137+
}
138+
}
139+
// Run Commercial Paper tests
140+
stage('Run Commercial Paper Tests') {
141+
steps {
142+
script {
143+
// making the output color coded
144+
// wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
145+
try {
146+
dir("$ROOTDIR/$BASE_DIR/scripts/ci_scripts") {
147+
// Run fabcar tests
148+
sh './ciScript.sh --commercialpaper_Tests'
149+
}
150+
}
151+
catch (err) {
152+
failure_stage = "commercialpaper_Tests"
153+
currentBuild.result = 'FAILURE'
154+
throw err
155+
}
156+
// }
157+
}
158+
}
159+
}
160+
} // stages
161+
post {
162+
always {
163+
// Archiving the .log files and ignore if empty
164+
archiveArtifacts artifacts: '**/*.log', allowEmptyArchive: true
165+
}
166+
failure {
167+
script {
168+
if (env.JOB_TYPE == 'merge') {
169+
// Send rocketChat notification to channel
170+
// Send merge build failure email notifications to the submitter
171+
sendNotifications(currentBuild.result, props["CHANNEL_NAME"])
172+
// Delete workspace when build is done
173+
cleanWs notFailBuild: true
174+
}
175+
}
176+
}
177+
} // post
178+
} // pipeline

0 commit comments

Comments
 (0)