Skip to content

Migrate portal backend builds from Task to build.sh #74

Description

@rashmithachamikara

Description

Currently, the portal backend utilizes Task instead of build.sh. The build system should probably depend on the deployment direction

What is Task

Go-Task (or simply Task) is a modern, cross-platform task runner and build tool written in Go that uses YAML-based configuration files to simplify running terminal commands, similar to GNU Make.

Differences

It is required to migrate the portal backend’s Taskfile.yml workflow to a build.sh workflow for consistency with the consent server.

Area Portal backend Consent server
Primary command cd portal/backend && task build From repo root: ./build.sh build [OS] [ARCH]
Underlying Go command go build -o bin/portal-backend[.exe] ./cmd/server GOOS=... GOARCH=... CGO_ENABLED=0 go build -ldflags ... -o ../target/server/consent-server ./cmd/server
Output portal/backend/bin/portal-backend target/server/consent-server
Cross-compilation Host OS only; adds .exe on Windows Explicit OS/architecture arguments
Runtime assets Binary only Copies config, startup script, DB scripts, API specs, README, and version

Key decisions to be made

  • Use a dedicated script for the portal backend or extend the root build.sh.
  • Define the command interface, binary name, and output directory.
  • Use a separate config YAML for the portal (commonly at portal root) or in portal-backend.
  • Decide whether cross-compilation and distribution packaging are required.
  • Decide how Windows developers will run the script. (For example, ThunderID maintains a PowerShell version for each script)
  • Determine whether to retain Task temporarily as a compatibility wrapper.
  • Decide which of the current commands (lint, fmt:check, test) to support in the new build.sh.
  • Decide which commands to be automatically executed on build ((lint, fmt:check, test)

Affected Product Version:

Current feature/portal branch

OS, DB, other environment details and versions:

Go 1.26.x; Linux, macOS, and Windows through Git Bash or WSL.

Steps to reproduce:

  1. Run task build from portal/backend.
  2. Compare it with ./build.sh build from the repository root.
  3. Observe that the two services use inconsistent build commands and artifact layouts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type/ImprovementMarks enhancements or improvements to existing features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions