-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to test extender and run it for extending the build image
Signed-off-by: Natalie Arellano <[email protected]>
- Loading branch information
1 parent
115e7f3
commit d5fb974
Showing
2 changed files
with
83 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
cd $LIFECYCLE_REPO_PATH | ||
|
||
echo ">>>>>>>>>> Building lifecycle..." | ||
|
||
docker image rm test-builder --force | ||
|
||
make clean build-linux-amd64 | ||
|
||
cd out/linux-amd64 | ||
|
||
cat << EOF > Dockerfile | ||
FROM cnbs/sample-builder:bionic | ||
COPY ./lifecycle /cnb/lifecycle | ||
EOF | ||
|
||
docker build -t test-builder . | ||
|
||
cd $SAMPLES_REPO_PATH | ||
|
||
rm -rf $SAMPLES_REPO_PATH/kaniko | ||
mkdir -p $SAMPLES_REPO_PATH/kaniko | ||
rm -rf $SAMPLES_REPO_PATH/layers/kaniko | ||
mkdir -p $SAMPLES_REPO_PATH/layers/kaniko | ||
|
||
echo ">>>>>>>>>> Running detect..." | ||
|
||
docker run \ | ||
-v $PWD/workspace/:/workspace \ | ||
-v $PWD/layers/:/layers \ | ||
-v $PWD/platform/:/platform \ | ||
-v $PWD/cnb/ext/:/cnb/ext \ | ||
-v $PWD/cnb/buildpacks/:/cnb/buildpacks \ | ||
test-builder \ | ||
/cnb/lifecycle/detector -order /layers/order.toml -log-level debug | ||
|
||
echo ">>>>>>>>>> Running build for extensions..." | ||
|
||
docker run \ | ||
-v $PWD/workspace/:/workspace \ | ||
-v $PWD/layers/:/layers \ | ||
-v $PWD/platform/:/platform \ | ||
-v $PWD/cnb/ext/:/cnb/ext \ | ||
-v $PWD/cnb/buildpacks/:/cnb/buildpacks \ | ||
test-builder \ | ||
/cnb/lifecycle/builder -use-extensions -log-level debug | ||
|
||
echo ">>>>>>>>>> Running extend on build image followed by build for buildpacks..." | ||
|
||
docker run \ | ||
-v $PWD/workspace/:/workspace \ | ||
-v $PWD/kaniko/:/kaniko \ | ||
-v $PWD/layers/:/layers \ | ||
-v $PWD/platform/:/platform \ | ||
-v $PWD/cnb/ext/:/cnb/ext \ | ||
-v $PWD/cnb/buildpacks/:/cnb/buildpacks \ | ||
-u root \ | ||
test-builder \ | ||
/cnb/lifecycle/extender kaniko build ubuntu:bionic | ||
# args: <kaniko|buildah> <build|run> <base-image> |