Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX: copy proper config files #296

Merged
5 changes: 2 additions & 3 deletions bin/client_build
Expand Up @@ -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`}
Expand All @@ -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
6 changes: 3 additions & 3 deletions bin/client_package_standalone
Expand Up @@ -15,6 +15,7 @@
set -e

source bin/helpers/output.sh
. ./bin/helpers/functions.sh

OS=$1
if [[ ! "$OS" =~ ^(linux|darwin|windows)$ ]]; then
Expand All @@ -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 -rp "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
Expand Down
9 changes: 9 additions & 0 deletions bin/helpers/functions.sh
Expand Up @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this function be generlized even more? I.e. copy_config with parameters $OS $DIR_TEMP ?

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
}
6 changes: 3 additions & 3 deletions bin/server_package_standalone
Expand Up @@ -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 -rp "bin/server_package/config/${OS}/" ${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
Expand Down