Skip to content

Commit

Permalink
Add quench when building the application
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszWojciechO authored Dec 6, 2024
1 parent 83a090e commit 4b094ef
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SALT=f1nd1ngn3m0
# * telio
# * drop
# * moose - internal builds only
# * quench - internal builds only
# * internal - internal builds only
FEATURES=telio drop
# Used for mage targets, when set to 1, fetching docker images will be skipped if it is already fetched.
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "third-party/moose-worker"]
path = third-party/moose-worker
url = ../../../../moose/moose-events.git
[submodule "third-party/libquench-go"]
path = third-party/libquench-go
url = ../../libquench-go
14 changes: 14 additions & 0 deletions ci/add_private_bindings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

bindings_name=$1
bindings_path=$2

go mod edit -require="$bindings_name"@v0.0.0
go mod edit -replace="$bindings_name"="$bindings_path"

function revert_private_bindings {
go mod edit -droprequire="$bindings_name"
go mod edit -dropreplace="$bindings_name"
}

trap revert_private_bindings EXIT
9 changes: 9 additions & 0 deletions ci/check_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ libmoose_worker_artifact_url="${LIBMOOSE_WORKER_ARTIFACTS_URL}/${LIBMOOSE_WORKER
libmoose_worker_zipfile="${temp_dir}/libmoose-worker-${LIBMOOSE_WORKER_VERSION}.zip"
libmoose_worker_dst="${temp_dir}/libmoose-worker-${LIBMOOSE_WORKER_VERSION}"

libquench_artifact_url="${LIBQUENCH_ARTIFACTS_URL}/${LIBQUENCH_VERSION}/linux.zip"
libquench_zipfile="${temp_dir}/libquench-${LIBQUENCH_VERSION}.zip"
libquench_dst="${temp_dir}/libquench-${LIBQUENCH_VERSION}"

lib_versions_file="${WORKDIR}/lib-versions.env"
checkout_completed_flag_file="${lib_root}/checkout-completed-flag"

Expand Down Expand Up @@ -109,6 +113,7 @@ fetch_gitlab_artifact "${libdrop_artifact_url}" "${libdrop_zipfile}"
if [[ "${FEATURES:-""}" == *internal* ]]; then
fetch_gitlab_artifact "${libmoose_nordvpnapp_artifact_url}" "${libmoose_nordvpnapp_zipfile}"
fetch_gitlab_artifact "${libmoose_worker_artifact_url}" "${libmoose_worker_zipfile}"
fetch_gitlab_artifact "${libquench_artifact_url}" "${libquench_zipfile}"
fi

# ====================[ Unzip files ]=========================
Expand All @@ -119,6 +124,7 @@ unzip -o "${libdrop_zipfile}" -d "${temp_dir}" && mv "${temp_dir}/libdrop" "${li
if [[ "${FEATURES:-""}" == *internal* ]]; then
unzip -o "${libmoose_nordvpnapp_zipfile}" -d "${temp_dir}" && mv "${temp_dir}/out" "${libmoose_nordvpnapp_dst}"
unzip -o "${libmoose_worker_zipfile}" -d "${temp_dir}" && mv "${temp_dir}/out" "${libmoose_worker_dst}"
unzip -o "${libquench_zipfile}" -d "${temp_dir}" && mv "${temp_dir}/dist" "${libquench_dst}"
fi

# ====================[ Copy to bin/deps/libs ]=========================
Expand All @@ -140,6 +146,9 @@ if [[ "${FEATURES:-""}" == *internal* ]]; then

# moose worker
copy_to_libs "${libmoose_worker_dst}/worker/bin/worker/linux" "libmooseworker.so"

# libquench
copy_to_libs "${libquench_dst}/linux/release" "libquench.so"
fi

# remove leftovers
Expand Down
7 changes: 6 additions & 1 deletion ci/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ if [[ $tags == *"moose"* ]]; then
-X 'main.EventsDomain=${events_domain:-""}' \
-X 'main.EventsSubdomain=${EVENTS_SUBDOMAIN:-""}'"

source "${WORKDIR}"/ci/add_moose.sh
source "${WORKDIR}"/ci/add_private_bindings.sh moose/events ./third-party/moose-events/moosenordvpnappgo/v14
source "${WORKDIR}"/ci/add_private_bindings.sh moose/worker ./third-party/moose-worker/mooseworkergo/v14
fi

if [[ $tags == *"quench"* ]]; then
source "${WORKDIR}"/ci/add_private_bindings.sh quench ./third-party/libquench-go
fi

for program in ${!names_map[*]}; do # looping over keys
Expand Down
3 changes: 2 additions & 1 deletion ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ tags="internal"
# everything
if [ "${1:-""}" = "full" ]; then
# Apply moose patch in case compiling with moose
source "${WORKDIR}"/ci/add_moose.sh
source "${WORKDIR}"/ci/add_private_bindings.sh moose/events ./third-party/moose-events/moosenordvpnappgo/v14
source "${WORKDIR}"/ci/add_private_bindings.sh moose/worker ./third-party/moose-worker/mooseworkergo/v14

excluded_packages="thisshouldneverexist"
excluded_categories="root,link"
Expand Down
1 change: 1 addition & 0 deletions lib-versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ LIBTELIO_VERSION=v5.0.3
LIBDROP_VERSION=v8.1.1
LIBMOOSE_NORDVPNAPP_VERSION=v14.3.0-nordVpnApp
LIBMOOSE_WORKER_VERSION=v14.3.0-worker
LIBQUENCH_VERSION=v0.0.16
1 change: 1 addition & 0 deletions third-party/libquench-go
Submodule libquench-go added at 76bb13

0 comments on commit 4b094ef

Please sign in to comment.