Skip to main content

magic containerized builds

Project description

redbuild

magic containerized builds

overview

redbuild enables software to be built in pre-defined environments using the power of containerization. with podman installed, any supported project can be built with a single command. projects provide a build.docker and build.sh for defining the build environment and build steps.

redbuild: just add water!

install stable version from pypi

# with pipx (recommended)
pipx install redbuild
# with vanilla pip
pip install redbuild

build from source

To build redbuild2, we will use the redbuild1 shell script to bootstrap the build environment and build redbuild2.

./bootstrap/redbuild.sh

this will output ./redbuild.bin which you can symlink to one of your $PATH directories.

Here is a suggested setup:

mkdir -p ~/.bin
ln -s $(pwd)/redbuild.bin ~/.bin/redbuild

Now, you can run redbuild from anywhere!

try the example!

cd example
redbuild build

detailed usage

creating the build environment and build script

  1. create a build.docker file in the project root. this file should contain a FROM directive for the base image to use for the build environment. the build environment should contain all the tools necessary to build the project. it's also very important that the last line of the dockerfile is CMD ["/bin/bash", "-l"]. this is necessary for redbuild to work.

    an example build.docker:

    FROM debian:bookworm-slim
    
    # install dependencies
    RUN apt-get update && apt-get install -y \
        bash \
        curl wget xz-utils \
        gcc make libc6-dev libcurl4 \
        git libxml2 \
        && rm -rf /var/lib/apt/lists/* && apt autoremove -y && apt clean
    
    
    # install dlang
    RUN curl -fsS https://dlang.org/install.sh | bash -s install ldc-1.30.0 \
        && echo "source ~/dlang/ldc-1.30.0/activate" >> ~/.bashrc
    
    # set up main to run bash (necessary for redbuild)
    CMD ["/bin/bash", "-l"]
    
  2. create a build.sh file in the project root. this file should contain the steps necessary to build the project. the build script should be written to be run in the build environment.

    build.sh:

    #!/bin/bash
    dub build --compiler ldc2 -B release
    

that's it! now you can build the project with redbuild build, copy it into the project root, and run it. you can also open an interactive shell in the build environment with redbuild shell.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redbuild-2.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

redbuild-2.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file redbuild-2.2.0.tar.gz.

File metadata

  • Download URL: redbuild-2.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/6.3.3-1-MANJARO

File hashes

Hashes for redbuild-2.2.0.tar.gz
Algorithm Hash digest
SHA256 7b88188ae3750a8fc69a78036c247c2d17bbc6860adb52906fb1d7b43fe8e62d
MD5 806d0f379a602c047dcfba401045eb87
BLAKE2b-256 4e9de2aa2528affa6f0c131a49dbf5788e83e0dd19bbb38d204c61bac76abdaf

See more details on using hashes here.

File details

Details for the file redbuild-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: redbuild-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/6.3.3-1-MANJARO

File hashes

Hashes for redbuild-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8a8a0d6d3a747a3fbf6a16636abe201ad5f182f18f3564bc54ca9b9ce58c894
MD5 26ec4ecfdc7618f3719e37cb9ad580ac
BLAKE2b-256 9016d803ef9dc6f07e429ed7aee13755d8b96a33228ea3883aefeeace4cc3748

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page