-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix libtelio/drop override in moose builds
- Loading branch information
1 parent
50a71ef
commit 1b6486f
Showing
2 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,9 @@ export CGO_LDFLAGS="${CGO_LDFLAGS:-""} -Wl,-z,relro,-z,now" | |
# In order to enable additional features, provide `FEATURES` environment variable | ||
tags="${FEATURES:-"telio drop"}" | ||
|
||
source "${WORKDIR}"/ci/set_bindings_version.sh libtelio | ||
source "${WORKDIR}"/ci/set_bindings_version.sh libdrop | ||
|
||
if [[ $tags == *"moose"* ]]; then | ||
# Set correct events domain in case compiling with moose | ||
if [[ "${ENVIRONMENT}" == "prod" ]]; then | ||
|
@@ -71,21 +74,19 @@ if [[ $tags == *"moose"* ]]; then | |
-X 'main.EventsDomain=${events_domain:-""}' \ | ||
-X 'main.EventsSubdomain=${EVENTS_SUBDOMAIN:-""}'" | ||
|
||
# Apply moose patch in case compiling with moose | ||
git apply "${WORKDIR}"/contrib/patches/add_moose.diff || \ | ||
# If applying fails try reverting and applying again | ||
(git apply -R "${WORKDIR}"/contrib/patches/add_moose.diff && \ | ||
git apply "${WORKDIR}"/contrib/patches/add_moose.diff) | ||
go mod edit -require=moose/[email protected] | ||
go mod edit -require=moose/[email protected] | ||
go mod edit -replace=moose/events=./third-party/moose-events/nordvpnapp/moosenordvpnappgo | ||
go mod edit -replace=moose/worker=./third-party/moose-worker/mooseworkergo | ||
function revert_moose_patch { | ||
cd "${WORKDIR}" | ||
git apply -R "${WORKDIR}"/contrib/patches/add_moose.diff | ||
go mod edit -droprequire=moose/events | ||
go mod edit -droprequire=moose/worker | ||
go mod edit -dropreplace=moose/events | ||
go mod edit -dropreplace=moose/worker | ||
} | ||
trap revert_moose_patch EXIT | ||
fi | ||
|
||
source "${WORKDIR}"/ci/set_bindings_version.sh libtelio | ||
source "${WORKDIR}"/ci/set_bindings_version.sh libdrop | ||
|
||
for program in ${!names_map[*]}; do # looping over keys | ||
pushd "${WORKDIR}/cmd/${program}" | ||
# BUILDMODE can be no value and `go` does not like empty parameter '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters