diff --git a/.gitpod.yml b/.gitpod.yml index 0f15a9696..e18d2e77e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -20,8 +20,9 @@ tasks: command: | gp await-port 5000 REPO=localhost:5000/dazzle - echo "To build specific chunks and combinations 'time ./dazzle-up.sh -c chunk1 -c chunk2 -n combo'" - echo "To build all the chunks and combinations 'time ./dazzle-up.sh'" + echo "To build specific chunks and combine them 'time ./build-chunk.sh -c chunk1 -c chunk2 -n combo'" + echo "To build all the chunks and combinations 'time ./build-all.sh'" + echo "To build a specific combination 'time ./build-combo.sh combo'" echo "To list image chunks 'dazzle project image-name $REPO'" echo "To list hashes for image chunks 'dazzle project hash $REPO'" echo "To print the combined image maniest 'dazzle project manifest $REPO'" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2877e51cb..c3f2d3b81 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ Here is a list of dependencies and tools: ## Locally -We ship a shell script [dazzle-up.sh](dazzle-up.sh) that can be used to build the images locally. See the following sub sections for usage. +We ship a shell script [build-all.sh](build-all.sh) that can be used to build the images locally. See the following sub sections for usage. This script will first build the chunks and run tests followed by creation of container images. It uses `dazzle` to perform these tasks. @@ -45,20 +45,28 @@ where `combo` is the name of the combination defined in [dazzle.yaml](dazzle.yam ### Build Specific Chunks -Often, you would want to test only the chunks that you modify. You can do that by using the `-c` flag. +Often, you would want to test only the chunks that you modify. You can do that with build-chunk.sh using the `-c` flag and specifying the name for your combination with `n`. ```console -./dazzle-up.sh -c lang-c -c dep-cacert-update -n mychangecombo +./build-chunk.sh -c lang-c -c dep-cacert-update -n mychangecombo ``` Above command will build only chunks `lang-c` and `dep-cacert-update` and combine the created chunks (all variants, if any exists) as a combination with name `mychangecombo`. +### Build Specific Combination +Sometimes you only want to build one specification combination e.g. the postgresql or the go image. You can do that with + +```console +./build-combo.sh +``` +This will build all chunks that are referenced by the go combination and then combine them to create the go image. + ### Build All Chunks Execute the following command to build using the default config `dazzle.yaml` shipped in this repo: ```bash -./dazzle-up.sh +./build-all.sh ``` > **NOTE:** Building images locally consumes a lot of resources and is often slow. diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 000000000..d1232aad6 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euo pipefail + +REPO=localhost:5000/dazzle +# First, build chunks without hashes +dazzle build $REPO -v --chunked-without-hash +# Second, build again, but with hashes +dazzle build $REPO -v +# Third, create combinations of chunks +dazzle combine $REPO --all -v \ No newline at end of file diff --git a/dazzle-up.sh b/build-chunk.sh similarity index 94% rename from dazzle-up.sh rename to build-chunk.sh index dd7a2c46b..c39729d86 100755 --- a/dazzle-up.sh +++ b/build-chunk.sh @@ -13,8 +13,8 @@ readonly REPO="localhost:5000/dazzle" function usage() { cat <