From 1c1ea5787dd8a180d45d77fcf458ffbb4fdb26e1 Mon Sep 17 00:00:00 2001 From: Rick van de Loo Date: Sat, 22 Oct 2022 14:17:48 +0200 Subject: [PATCH] add instructions to build and run local image add instructions to the README.md on how to build and use a local image (for development) --- README.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7d7fa5c..10801cd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,31 @@ If you are looking to see how the internals of the deployment tool work or even This project builds the hypernode/deploy container image. +## Building and running a local image + +If you don't want to use a pre-built image from https://quay.io/hypernode/deploy or if you are doing development on this project and you want to test out your changes, you can built an image locally and use that. + +```bash +export LOCAL_BUILD= # So we don't try to push +export CONTAINER_IMAGE=hypernode/deploy/dev +export PHP_VERSION=7.4 +export NODE_VERSION=14 +bash -x ci/build.sh +``` + +This will give you a locally built image: +```bash +$ docker images | grep hypernode/deploy/dev +hypernode/deploy/dev php7.4-node14 ece785ad21f5 2 minutes ago 753MB +``` + +That you could then use like: +```bash +$ rm -Rf vendor # in case we need to do some cleanup +$ docker run --rm -it --env SSH_PRIVATE_KEY="$(cat ~/.ssh/yourdeploykey | base64)" -v ${PWD}:/build hypernode/deploy/dev:php7.4-node14 hypernode-deploy build -vvv +$ docker run --rm -it --env SSH_PRIVATE_KEY="$(cat ~/.ssh/yourdeploykey | base64)" -v ${PWD}:/build hypernode/deploy/dev:php7.4-node14 hypernode-deploy deploy staging -vvv +``` + ## Switching node version ```bash @@ -27,10 +52,3 @@ tools/vendor/bin/grumphp run --config tools/grumphp.yml ### Docker container We use Google Container Structure Tests over https://github.com/aelsabbahy/goss because the Hipex deploy container does not require a health check. - -## Run with local image - -```bash -rm -Rf vendor -docker run --rm -it --env SSH_PRIVATE_KEY="$(cat ~/.ssh/id_rsa_mydeploykey | base64)" -v ${PWD}:/build hipex/deploy/dev:2.1.0-php7.3-node13 hipex-deploy build -vvv -```