Skip to content

Commit

Permalink
Merge pull request #296 from Waldz/hotfix/fix-standalone-packaging
Browse files Browse the repository at this point in the history
HOTFIX: copy proper config files
  • Loading branch information
zolia authored Jul 13, 2018
2 parents b84f64e + f30b7f6 commit 62027fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
5 changes: 2 additions & 3 deletions bin/client_build
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 {
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
Original file line number Diff line number Diff line change
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

0 comments on commit 62027fd

Please sign in to comment.