-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FABN-1169] auto-gen test certs in build
- Add gulp scripts to automatically download fabric binaries and generate certs - Add generate certs step to Jenkins build scripts - Remove git-cached certs from repository - Add to ReadMe files the required initial steps to get certs locally Change-Id: Id13634c6bcc1bb8daab531bd8185da58cb5093f8 Signed-off-by: nkl199@yahoo.co.uk <nkl199@yahoo.co.uk>
- Loading branch information
Showing
130 changed files
with
617 additions
and
1,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
const gulp = require('gulp'); | ||
const shell = require('gulp-shell'); | ||
const runSequence = require('run-sequence'); | ||
|
||
const version = '1.4.0'; | ||
const binariesPath = '/tmp/fabric-binaries'; | ||
const darwinTarFile = 'hyperledger-fabric-darwin-amd64-' + version + '.tar.gz'; | ||
const amd64TarFile = 'hyperledger-fabric-linux-amd64-' + version + '.tar.gz'; | ||
const s390TarFile = 'hyperledger-fabric-linux-s390x-' + version + '.tar.gz'; | ||
const darwin = 'darwin-amd64-' + version + '/' + darwinTarFile; | ||
const amd64 = 'linux-amd64-' + version + '/' + amd64TarFile; | ||
const s390 = 'linux-s390x-' + version + '/' + s390TarFile; | ||
const binariesRoot = 'https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/'; | ||
const darwinBinaries = binariesRoot + darwin; | ||
const amd64Binaries = binariesRoot + amd64; | ||
const s390Binaries = binariesRoot + s390; | ||
|
||
// Retrieve the cryptogen material binaries, pinned at 1.4 | ||
// Download and xxtract binaries from tar file | ||
// Set to path via export | ||
gulp.task('get-crypto-binaries-amd64', shell.task( | ||
'mkdir -p ' + binariesPath + ';' + | ||
'wget ' + amd64Binaries + ' -P ' + binariesPath + ';' + | ||
'tar xvzf ' + binariesPath + '/' + amd64TarFile + ' -C ' + binariesPath + ';') | ||
); | ||
|
||
gulp.task('get-crypto-binaries-mac', shell.task( | ||
'mkdir -p ' + binariesPath + ';' + | ||
'wget ' + darwinBinaries + ' -P ' + binariesPath + ';' + | ||
'tar xvzf ' + binariesPath + '/' + darwinTarFile + ' -C ' + binariesPath + ';') | ||
); | ||
|
||
gulp.task('get-crypto-binaries-s390', shell.task( | ||
'mkdir -p ' + binariesPath + ';' + | ||
'wget ' + s390Binaries + ' -P ' + binariesPath + ';' + | ||
'tar xvzf ' + binariesPath + '/' + s390TarFile + ' -C ' + binariesPath + ';') | ||
); | ||
|
||
// Generate required crypto material, channel tx blocks, and fabric ca certs | ||
// - shell command to run the required test file scripts | ||
gulp.task('generate-test-certs', shell.task( | ||
'./test/fixtures/crypto-material/generateAll.sh ' + binariesPath + '/bin;' + | ||
'./test/fixtures/fabricca/generateCSR.sh;') | ||
); | ||
|
||
// Perform both of the above sequentially | ||
gulp.task('install-and-generate-certs', (done) => { | ||
const tasks = ['get-crypto-binaries-amd64', 'generate-test-certs']; | ||
runSequence(...tasks, done); | ||
}); | ||
|
||
gulp.task('install-and-generate-certs-mac', (done) => { | ||
const tasks = ['get-crypto-binaries-mac', 'generate-test-certs']; | ||
runSequence(...tasks, done); | ||
}); | ||
|
||
gulp.task('install-and-generate-certs-s390', (done) => { | ||
const tasks = ['get-crypto-binaries-s390', 'generate-test-certs']; | ||
runSequence(...tasks, done); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
Cryptogen created using fabric 1.4 level cryptogen using `generate.sh` | ||
|
||
Mulitple configs are generated: | ||
- config-base, does not include anchor peers | ||
- config-update, used to update anchor peers | ||
|
||
Both folders contain a ./generate.sh to run, that creates new material to be used. A smart person would use a script to run them both, that's what `generateAll.sh` does | ||
|
||
Don't forget: | ||
- export the cryptogen path before you run the command, toherwise it will fail, and you will cry | ||
|
||
The above is to be automated in the build so that we create new material prior to evey test, which will prevent certifaicate expiration issues. | ||
All crypto material here is generated via the contained shell scripts files and orchestrated by the parent gulp files `/build/tasks/certs.js`, please use the gulp files to create any required certificates by: | ||
- Obtain crypto-gen binaries (`gulp get-crypto-binaries`) | ||
- Generate the crypto material required for tests (`gulp generate-test-certs`) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-284 Bytes
test/fixtures/crypto-material/channel-config/mychannel-org1anchor.tx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.