Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add podman script/alias support to build and push scripts #108

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/build_viewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
# limitations under the License.

#!/usr/bin/env bash
shopt -s expand_aliases
set -eux

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

# Set Docker/Podman alias if necessary
. ${ABSOLUTE_PATH}/setenv.sh

docker build --no-cache -t registry-viewer $BUILD_DIR \
--build-arg PROJECT_NAME=registry-viewer \
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"}
8 changes: 8 additions & 0 deletions scripts/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@
# limitations under the License.

#!/usr/bin/env bash
shopt -s expand_aliases
set -eux

BASE_TAG=$1
IMAGE_TAG=$2

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

# Set Docker/Podman alias if necessary
. ${ABSOLUTE_PATH}/setenv.sh

docker tag $BASE_TAG $IMAGE_TAG
docker push $IMAGE_TAG
25 changes: 25 additions & 0 deletions scripts/setenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

# This script aliases the docker cli if the environment variable USE_PODMAN is set to true.

# default value is false if USE_PODMAN is unset or null
podman=${USE_PODMAN:-false}
if [ ${podman} == true ]; then
alias docker=podman
echo "setting alias docker=podman"
fi
Loading