Skip to content

Commit

Permalink
[FABN-886]Fix gulp docker-clean for network-e2enodecc
Browse files Browse the repository at this point in the history
`gulp docker-clean` doesn’t remove Chaincode's docker containers
and images of network-e2enodecc. The script (./build/task/test.js)
runs `grep` command to search docker containers and images
containing Chaincode’s name. The current `grep` command can’t find
Chaincode named `network-e2enodecc`, which is used for the
end-to-end test of fabric-network.

This CR fixes the regular expression in the script to search
and remove the remaining containers and images.

FABN-886 #done

Change-Id: Ia172dba1be995b728de39bf723abdc6c249b43c9
Signed-off-by: Yuki Kondo <[email protected]>
  • Loading branch information
yuki-kon committed Aug 23, 2018
1 parent cb591c5 commit ab85e84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ gulp.task('clean-up', () => {

gulp.task('docker-clean', shell.task([
// stop and remove chaincode docker instances
'docker kill $(docker ps | grep "dev-peer0.org[12].example.com-e" | awk \'{print $1}\')',
'docker rm $(docker ps -a | grep "dev-peer0.org[12].example.com-e" | awk \'{print $1}\')',
'docker kill $(docker ps | grep "dev-peer0.org[12].example.com-[en]" | awk \'{print $1}\')',
'docker rm $(docker ps -a | grep "dev-peer0.org[12].example.com-[en]" | awk \'{print $1}\')',

// remove chaincode images so that they get rebuilt during test
'docker rmi $(docker images | grep "^dev-peer0.org[12].example.com-e" | awk \'{print $3}\')',
'docker rmi $(docker images | grep "^dev-peer0.org[12].example.com-[en]" | awk \'{print $3}\')',

// clean up all the containers created by docker-compose
'docker-compose -f test/fixtures/docker-compose.yaml down'
Expand Down

0 comments on commit ab85e84

Please sign in to comment.