Skip to content

Commit 2223f1b

Browse files
authored
Merge pull request #108 from Jdubrick/main
add podman script/alias support to build and push scripts
2 parents 36efa79 + 99ac9df commit 2223f1b

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

scripts/build_viewer.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
# limitations under the License.
1414

1515
#!/usr/bin/env bash
16+
shopt -s expand_aliases
17+
set -eux
1618

1719
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1820
BUILD_DIR=$ABSOLUTE_PATH/..
1921

22+
# Set Docker/Podman alias if necessary
23+
. ${ABSOLUTE_PATH}/setenv.sh
24+
2025
docker build --no-cache -t registry-viewer $BUILD_DIR \
2126
--build-arg PROJECT_NAME=registry-viewer \
2227
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"}

scripts/push.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@
1313
# limitations under the License.
1414

1515
#!/usr/bin/env bash
16+
shopt -s expand_aliases
17+
set -eux
1618

1719
BASE_TAG=$1
1820
IMAGE_TAG=$2
21+
22+
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23+
24+
# Set Docker/Podman alias if necessary
25+
. ${ABSOLUTE_PATH}/setenv.sh
26+
1927
docker tag $BASE_TAG $IMAGE_TAG
2028
docker push $IMAGE_TAG

scripts/setenv.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright Red Hat
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# This script aliases the docker cli if the environment variable USE_PODMAN is set to true.
19+
20+
# default value is false if USE_PODMAN is unset or null
21+
podman=${USE_PODMAN:-false}
22+
if [ ${podman} == true ]; then
23+
alias docker=podman
24+
echo "setting alias docker=podman"
25+
fi

0 commit comments

Comments
 (0)