Skip to content

Proposal: reorganize hack/ build scripts #35937

@dnephin

Description

@dnephin

Problem Statement

The organization of build scripts in hack/ has remained largely unchanged for a long time. This repo has undergone significant changes and the build scripts could use a refresh.

Goals

  • remove hack/make.sh so that scripts can be executed directly without a driver
  • keep a clear distinction between libraries (currently files prefixed with .) and "task scripts"
  • group the scripts by high level operation (build, test, release, etc)
  • remove anything that is no longer used
  • support upcoming changes to the repo, (Rename binaries to moby-* #34226 and Completing the Moby transition #35115)

Proposal

  • remove hack/make.sh, and move everything out of hack/make to a new location under hack
  • any setup logic in hack/make.sh will move to a library under hack/lib or hack/<category>/lib

Structure:

hack
|--- ci        # CI container entrypoints, one script per CI build (already exists)
|--- run       # scripts for running the daemon (ex dind, hack/make/run)
|--- release   # scripts for releasing new versions (ex: generate-authors.sh)
|--- build     # scripts for building the binaries (hack/make/binary*, hack/make/cross)
     `--- generate # generate code (generate-swagger-api.sh, hack/make/.go-autogen)
|--- test     # scripts for running test suites (hack/test already exists)
|--- validate # scripts for validating code, linting, etc (already exists)
|--- deps     # installing dependencies, (vendor.sh, and hack/dockerfile/)
|--- libs 

Anything in libs should only define functions, nothing should run when sourced. Each directory can also have a libs directory for anything that is not general enough to be at the top level

(hack/integration-cli-on-swarm/ could be moved back to contrib/ since it's mostly go code, or would be under hack/test/integration-cli-on-swarm/)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions