Skip to content

Feature Request: Add Conditional publish Stage to tf-dev-env #101

@nontaphatnj

Description

@nontaphatnj

Feature Request: Add Optional publish Stage to tf-dev-env

Summary

Introduce an optional publish stage in container/run.sh to support pushing built container images to a custom/external registry.
This stage runs only when explicitly enabled via environment variables.

Problem

tf-dev-env currently does not provide a built-in way to publish images to external registries.
Users must manually re-tag and push images after a build, which is inefficient and error-prone.

Proposed Solution

Add a conditional publish stage that:

  • Runs only when CONTRAIL_REGISTRY_PUSH is defined
  • Re-tags built images to the target registry
  • Performs docker login when CONTRAIL_REGISTRY_USERNAME and CONTRAIL_REGISTRY_PASSWORD are provided
  • Pushes images automatically
  • Skips the stage when not configured

Example Usage

export CONTRAIL_REGISTRY_PUSH="my-registry.example.com"
export CONTRAIL_REGISTRY_USERNAME="myuser"
export CONTRAIL_REGISTRY_PASSWORD="mypassword"

./run.sh build


There are stages available to run ./run.sh <stage>:
  build     - perform sequence of stages: fetch, configure, compile, package, publish (if configured)
              (if stage was run previously it be skipped)
  fetch     - sync TF git repos
  configure - fetch third party packages and install dependencies
  compile   - build TF binaries
  package   - package TF into docker containers (you can specify target container to build like container-vrouter)
  test      - run unittests
  freeze    - prepare tf-dev-env for pushing to container registry for future reuse by compressing contrail directory
  upload    - push tf-dev-env to container registry
  publish   - push built containers to custom registry (requires CONTRAIL_REGISTRY_PUSH)
  none      - create the tf-dev-env container empty
  frozen    - fetch frozen tf-dev-env from Ci registry, you still have to use run.sh or fetch/configure to get sources
  doxygen   - builds doxygen documentation for the project

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions