Skip to content

Commit

Permalink
Add podman support for the build and deploy scripts (#244)
Browse files Browse the repository at this point in the history
* add podman support to build.sh

Signed-off-by: Jordan Dubrick <[email protected]>

* podman support for build_and_deploy.sh and update docs

Signed-off-by: Jordan Dubrick <[email protected]>

* add podman capabilities to build scripts and update docs for usage

Signed-off-by: Jordan Dubrick <[email protected]>

* remove commented out block

Signed-off-by: Jordan Dubrick <[email protected]>

* typo fix

Signed-off-by: Jordan Dubrick <[email protected]>

---------

Signed-off-by: Jordan Dubrick <[email protected]>
  • Loading branch information
Jdubrick authored Nov 24, 2023
1 parent 1464914 commit 226b36f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
shopt -s expand_aliases

ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
USE_PODMAN=${USE_PODMAN:-false}

if [[ ${USE_PODMAN} == true ]]; then
alias docker=podman
echo "using podman as container engine"
fi

if [ $# -eq 1 ] && [ $1 == "offline" ]
then
Expand Down
8 changes: 8 additions & 0 deletions .ci/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
shopt -s expand_aliases
set -ex
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
GIT_REV="$(git rev-parse --short=7 HEAD)"
INDEX_IMAGE="${INDEX_IMAGE:-quay.io/app-sre/devfile-index}"
VIEWER_IMAGE="${VIEWER_IMAGE:-quay.io/app-sre/registry-viewer}"
IMAGE_TAG="${IMAGE_TAG:-${GIT_REV}}"
USE_PODMAN=${USE_PODMAN:-false}

# Ensure container engine is set properly for devfile-web scripts
if [[ ${USE_PODMAN} == true ]]; then
alias docker=podman
echo "using podman as container engine"
fi

# Run the build script
bash $ABSOLUTE_PATH/build.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you are a stack owner and need to request an urgent refresh of <https://regis

### Build

To build this devfile registry into a container image run `bash .ci/build.sh`. A container image will be built using the [devfile registry build tools](https://github.com/devfile/registry-support/tree/master/build-tools).
To build this devfile registry into a container image run `bash .ci/build.sh`. A container image will be built using the [devfile registry build tools](https://github.com/devfile/registry-support/tree/master/build-tools). By default these scripts will use `docker`, if you want to use `podman` you should first run `export USE_PODMAN=true` before executing the build script.

From there, push the container image to a container registry of your choice and deploy using one of the methods outlined [here](https://github.com/devfile/registry-support#deploy).

Expand Down

0 comments on commit 226b36f

Please sign in to comment.