From 44573e4a78510475651baa9ff2ee0029ed1eda1d Mon Sep 17 00:00:00 2001 From: Antanas Masevicius Date: Thu, 12 Jul 2018 09:31:21 +0300 Subject: [PATCH 1/3] copy proper config files --- bin/client_package_standalone | 2 +- bin/server_package_standalone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/client_package_standalone b/bin/client_package_standalone index db2ad95e1b..e622722a2a 100755 --- a/bin/client_package_standalone +++ b/bin/client_package_standalone @@ -30,7 +30,7 @@ printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` cp -p ${BINARY} ${DIR_TEMP}/mysterium_client cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -rp "bin/client_package/config/${OS}/" ${DIR_TEMP}/config 2>/dev/null || true +cp -p "bin/client_package/config/${OS}/" ${DIR_TEMP}/config 2>/dev/null || true # Tarball package directory if [ "$OS" == "windows" ]; then diff --git a/bin/server_package_standalone b/bin/server_package_standalone index 1806506928..418a0d43e3 100755 --- a/bin/server_package_standalone +++ b/bin/server_package_standalone @@ -30,7 +30,7 @@ printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` cp -p ${BINARY} ${DIR_TEMP}/mysterium_server cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -rp "bin/server_package/config/${OS}/" ${DIR_TEMP}/config 2>/dev/null || true +cp -p "bin/server_package/config/" ${DIR_TEMP}/config 2>/dev/null || true # Tarball package directory if [ "$OS" == "windows" ]; then From 7a71fc353a19544274924ecda51c37ef85190c24 Mon Sep 17 00:00:00 2001 From: Antanas Masevicius Date: Thu, 12 Jul 2018 09:31:21 +0300 Subject: [PATCH 2/3] copy proper config files --- bin/client_package_standalone | 2 +- bin/server_package_standalone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/client_package_standalone b/bin/client_package_standalone index db2ad95e1b..f078ae2dec 100755 --- a/bin/client_package_standalone +++ b/bin/client_package_standalone @@ -30,7 +30,7 @@ printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` cp -p ${BINARY} ${DIR_TEMP}/mysterium_client cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -rp "bin/client_package/config/${OS}/" ${DIR_TEMP}/config 2>/dev/null || true +cp -p "bin/client_package/config/${OS}/*" ${DIR_TEMP}/config 2>/dev/null || true # Tarball package directory if [ "$OS" == "windows" ]; then diff --git a/bin/server_package_standalone b/bin/server_package_standalone index 1806506928..6f3fcba3e0 100755 --- a/bin/server_package_standalone +++ b/bin/server_package_standalone @@ -30,7 +30,7 @@ printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` cp -p ${BINARY} ${DIR_TEMP}/mysterium_server cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -rp "bin/server_package/config/${OS}/" ${DIR_TEMP}/config 2>/dev/null || true +cp -p "bin/server_package/config/*" ${DIR_TEMP}/config 2>/dev/null || true # Tarball package directory if [ "$OS" == "windows" ]; then From 3806888c67d95b6125d1598ccc8bc1ba45c0cd57 Mon Sep 17 00:00:00 2001 From: Antanas Masevicius Date: Thu, 12 Jul 2018 13:05:45 +0300 Subject: [PATCH 3/3] copy client config travis way --- bin/client_build | 5 ++--- bin/client_package_standalone | 6 +++--- bin/helpers/functions.sh | 9 +++++++++ bin/server_package_standalone | 6 +++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bin/client_build b/bin/client_build index 454d44619e..1ca99a623c 100755 --- a/bin/client_build +++ b/bin/client_build @@ -16,7 +16,7 @@ #> brew install readelf #> readelf -d build/client/mysterium_client -source bin/helpers/functions.sh +. ./bin/helpers/functions.sh export GOOS=${GOOS:-`go env GOHOSTOS`} export GOARCH=${GOARCH:-`go env GOHOSTARCH`} @@ -31,7 +31,6 @@ fi mkdir -p $GOBIN/config -cp -vp bin/client_package/config/$GOOS/* $GOBIN/config -cp -vp bin/common_package/* $GOBIN/config +copy_client_config $GOOS $GOBIN exit 0 diff --git a/bin/client_package_standalone b/bin/client_package_standalone index f078ae2dec..b85c4ca13f 100755 --- a/bin/client_package_standalone +++ b/bin/client_package_standalone @@ -15,6 +15,7 @@ set -e source bin/helpers/output.sh +. ./bin/helpers/functions.sh OS=$1 if [[ ! "$OS" =~ ^(linux|darwin|windows)$ ]]; then @@ -28,9 +29,8 @@ DIR_BUILD="build/package" # Put all files to package directory (to avoid preserving directory structure) printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` -cp -p ${BINARY} ${DIR_TEMP}/mysterium_client -cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -p "bin/client_package/config/${OS}/*" ${DIR_TEMP}/config 2>/dev/null || true +cp -vp ${BINARY} ${DIR_TEMP}/mysterium_client +copy_client_config $OS $DIR_TEMP # Tarball package directory if [ "$OS" == "windows" ]; then diff --git a/bin/helpers/functions.sh b/bin/helpers/functions.sh index 3ebb927df6..161c1105ae 100644 --- a/bin/helpers/functions.sh +++ b/bin/helpers/functions.sh @@ -7,3 +7,12 @@ function get_linker_ldflags { [ -n "$BUILD_NUMBER" ] && echo -n "-X 'github.com/mysterium/node/metadata.BuildNumber=${BUILD_NUMBER}' " [ -n "$BUILD_VERSION" ] && echo -n "-X 'github.com/mysterium/node/metadata.Version=${BUILD_VERSION}' " } + +function copy_client_config { + local OS_DIR=$1 + local DST_DIR=$2 + cp -vrp "bin/common_package/" ${DST_DIR}/config + if [[ -d "bin/client_package/config/${OS_DIR}/" ]]; then + cp -vrp "bin/client_package/config/${OS_DIR}/." ${DST_DIR}/config + fi +} diff --git a/bin/server_package_standalone b/bin/server_package_standalone index 6f3fcba3e0..30f92404ef 100755 --- a/bin/server_package_standalone +++ b/bin/server_package_standalone @@ -28,9 +28,9 @@ DIR_BUILD="build/package" # Put all files to package directory (to avoid preserving directory structure) printf "Building Standalone package for OS '$OS' ..\n" DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX` -cp -p ${BINARY} ${DIR_TEMP}/mysterium_server -cp -rp "bin/common_package/" ${DIR_TEMP}/config -cp -p "bin/server_package/config/*" ${DIR_TEMP}/config 2>/dev/null || true +cp -vp ${BINARY} ${DIR_TEMP}/mysterium_server +cp -vrp "bin/common_package/" ${DIR_TEMP}/config +cp -vrp "bin/server_package/config/." ${DIR_TEMP}/config # Tarball package directory if [ "$OS" == "windows" ]; then