-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade dependencies Signed-off-by: Oleksii Orel <[email protected]>
- Loading branch information
Showing
5 changed files
with
83 additions
and
8 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 |
---|---|---|
|
@@ -13,7 +13,7 @@ It supports the following package managers: | |
## Build | ||
|
||
```sh | ||
./build.sh | ||
scripts/build.sh | ||
``` | ||
|
||
## Usage | ||
|
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,6 @@ | ||
#!/bin/sh | ||
# Simple script that helps to build local version to test easily | ||
set -e | ||
set -u | ||
|
||
${PWD}/scripts/container_tool.sh build -f Dockerfile -t quay.io/che-incubator/dash-licenses:local . |
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,51 @@ | ||
#!/bin/bash | ||
|
||
# Function to check if a command is available | ||
command_exists() { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Check for Podman | ||
if command_exists "podman"; then | ||
# Check if Podman machine is running | ||
if podman info &>/dev/null; then | ||
container_engine="podman" | ||
fi | ||
fi | ||
|
||
# Check for Docker | ||
if command_exists "docker"; then | ||
# Check if Docker daemon is running | ||
if docker info &>/dev/null; then | ||
container_engine="docker" | ||
fi | ||
fi | ||
|
||
# If neither Podman nor Docker is found or running | ||
if [ -z "$container_engine" ]; then | ||
echo "Neither Podman nor Docker is installed or running." | ||
exit 1 | ||
fi | ||
|
||
# Run command using Docker or Podman whichever is available | ||
container_tool() { | ||
local command=$1 | ||
shift | ||
|
||
echo "Container engine: $container_engine" | ||
"$container_engine" "$command" "$@" | ||
} | ||
|
||
# Main script | ||
case "$1" in | ||
build | run | push) | ||
set -e | ||
container_tool "$@" | ||
;; | ||
*) | ||
echo "Unknown command. Use: build, run, or push." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |