Commit a3f3ada5 authored by Antonio Gines Buendia Lopez's avatar Antonio Gines Buendia Lopez
Browse files

feat: rename and update build script for selective component compilation

Renamed 'compile_components.sh' to 'build_components.sh' and enhanced it to allow selective component compilation. This speeds up development by enabling targeted builds, preventing manual TFS_COMPONENTS changes. Updated 'my_deploy.sh' to ensure Docker images are rebuilt. Addresses part of #364.
parent eb8402fa
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
@@ -13,6 +13,59 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# -----------------------------------------------------------------------------
# This script enables selective compilation of specific TeraFlowSDN (TFS)
# components to facilitate faster development and debugging workflows.
#
# Instead of building the full set of components, developers can specify a
# subset of components to compile. The script temporarily overrides the
# TFS_COMPONENTS environment variable with the user-provided list, invokes
# the standard build process (build-only.sh), and restores the original
# environment afterwards.
#
# Purpose:
# - Speed up development iterations by limiting builds to relevant components.
# - Avoid manual modification of the TFS_COMPONENTS environment variable.
# - Provide a safe mechanism to temporarily override build configuration.
#
# How it works:
# 1. Stores the current value of TFS_COMPONENTS (if defined).
# 2. Parses user input to determine which components to build.
# 3. Sets TFS_COMPONENTS to the specified components.
# 4. Executes the existing build-only.sh script.
# 5. Restores the original TFS_COMPONENTS value automatically on exit
#    (whether the build succeeds or fails).
#
# Usage:
#   ./build_components.sh <component1> [component2] [component3] ...
#
#   or
#
#   ./build_components.sh "component1 component2 component3"
#
# Examples:
#   ./build_components.sh context device pathcomp service
#   ./build_components.sh "context device pathcomp service"
#
# Warning:
# - This script must be used with caution.
# - Some components have implicit dependencies on others. Modifying one
#   component may require rebuilding additional components even if their
#   source code has not been changed.
# - It is the developer's responsibility to ensure that all required
#   components are included in the build to avoid inconsistent or broken
#   states.
#
# Notes:
# - This script does not modify the persistent environment; changes to
#   TFS_COMPONENTS are temporary and scoped to the script execution.
# - It relies on the existing build-only.sh script located in the same
#   directory.
#
# -----------------------------------------------------------------------------


# Save previous TFS_COMPONENTS to revert them after the compilation is successful
PREV_TFS_COMPONENTS="${TFS_COMPONENTS:-}"

+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"
export TFS_GRAFANA_PASSWORD="admin123+"

# Disable skip-build flag to rebuild the Docker images.
export TFS_SKIP_BUILD="YES"
export TFS_SKIP_BUILD=""


# ----- CockroachDB ------------------------------------------------------------