Skip to content

Commit

Permalink
FAB-8399 use specified thirdparty docker image in tests
Browse files Browse the repository at this point in the history
This patch pulls the specified thirdparty docker image tag (couchdb)
in both release and snapshot versions. Also, pulls the specified fabric
version if it is a release version otherwise it looks for the default
image tag (latest).

Change-Id: I236a2145bacd5e19499ddeb79a6bb7ccd4d118c5
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
rameshthoomu committed Feb 23, 2018
1 parent b7418f8 commit 9a2d489
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,28 @@ console.log('####################################################\n');
let arch = process.arch;
let dockerImageTag = '';
let thirdpartyImageTag = '';
let docker_arch = '';
let release = require(path.join(__dirname, '../../fabric-client/package.json')).version;
let thirparty_release = require(path.join(__dirname, '../../fabric-client/package.json')).thirdparty;
if (!/-snapshot/.test(release)) {
// this is a release build, need to build the proper docker image tag
// to run the tests against the corresponding fabric released docker images
if (arch.indexOf('x64') === 0)
dockerImageTag = ':x86_64';
else if (arch.indexOf('s390') === 0)
dockerImageTag = ':s390x';
else if (arch.indexOf('ppc64') === 0)
dockerImageTag = ':ppc64le';
else
throw new Error('Unknown architecture: ' + arch);

thirdpartyImageTag = dockerImageTag + '-' + thirparty_release;
dockerImageTag += '-' + release;

// this is a release build, need to build the proper docker image tag
// to run the tests against the corresponding fabric released docker images
if (arch.indexOf('x64') === 0) {
docker_arch = ':x86_64';
} else if (arch.indexOf('s390') === 0) {
docker_arch = ':s390x';
} else if (arch.indexOf('ppc64') === 0) {
docker_arch = ':ppc64le';
} else {
throw new Error('Unknown architecture: ' + arch);
}
// prepare thirdpartyImageTag (currently using couchdb image in tests)
thirdpartyImageTag = docker_arch + '-' + thirparty_release;

// release check
if (!/-snapshot/.test(release)) {
dockerImageTag = docker_arch + '-' + release;
}
// these environment variables would be read at test/fixtures/docker-compose.yaml
process.env.DOCKER_IMG_TAG = dockerImageTag;
process.env.THIRDPARTY_IMG_TAG = thirdpartyImageTag;
Expand Down

0 comments on commit 9a2d489

Please sign in to comment.