Skip to content

Commit b54d8bb

Browse files
Simon Stonembwhite
authored andcommitted
[FABCJ-280] Copy chaincode into temporary directory before building
Signed-off-by: Simon Stone <[email protected]>
1 parent dac90d2 commit b54d8bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

fabric-chaincode-docker/build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/bash
22

3+
TMP_DIR=$(mktemp -d)
4+
35
buildGradle() {
4-
cd "$1" > /dev/null
6+
echo "Copying from $1 to ${TMP_DIR}"
7+
cd $1
8+
tar cf - . | (cd ${TMP_DIR}; tar xf -)
9+
cd ${TMP_DIR}
510
echo "Gradle build"
611
gradle build shadowJar -x test
712
retval=$?
@@ -17,7 +22,10 @@ buildGradle() {
1722
}
1823

1924
buildMaven() {
20-
cd "$1" > /dev/null
25+
echo "Copying from $1 to ${TMP_DIR}"
26+
cd $1
27+
tar cf - . | (cd ${TMP_DIR}; tar xf -)
28+
cd ${TMP_DIR}
2129
echo "Maven build"
2230
mvn -B compile package -DskipTests -Dmaven.test.skip=true
2331
retval=$?

0 commit comments

Comments
 (0)