Compare commits

..

5 Commits

Author SHA1 Message Date
ec4c0d09a6 add some colors 2023-10-08 00:55:19 +05:00
7c54edc17b it was a wrong thing lol 2023-10-08 00:53:58 +05:00
a29d22aff2 how to update 2023-10-08 00:53:12 +05:00
bc78d63da2 install command 2023-10-08 00:52:02 +05:00
58b4e61fd0 build and push works, somewhat 2023-10-08 00:39:43 +05:00
2 changed files with 33 additions and 2 deletions

View File

@@ -14,3 +14,13 @@ podman-compose.yml
container-compose.yaml container-compose.yaml
container-compose.yml container-compose.yml
``` ```
# Install system-wide
**WARNING: DO NOT RUN RANDOM COMMANDS OFF THE INTERNET LIKE THIS, READ WHAT IT DOES AND RUN ONLY IF YOU CAN TRUST IT!**
*anyway..*
```bash
sudo curl -L https://git.shihaam.dev/shihaam/container-compose/raw/branch/main/container-compose -o /usr/local/bin/container-compose \
&& sudo chmod +x /usr/local/bin/container-compose
```
Run the same command again to update it.

View File

@@ -23,7 +23,7 @@ check_file() {
shift # Remove build from positional parameters shift # Remove build from positional parameters
;; ;;
push) push)
push=push push=true
shift # Remove build from positional parameters shift # Remove build from positional parameters
;; ;;
pull) pull)
@@ -170,10 +170,28 @@ push(){
if [ -z "$context" ]; then if [ -z "$context" ]; then
context="." context="."
fi fi
echo push both tags cmd: $engine push $new_image_tag
$engine push $new_image_tag $engine push $new_image_tag
done done
################################################################ BOTH IMAGES PUSHED
manifest_create_cmd="$engine manifest create $image"
echo $manifest_create_cmd
services=$(yq e '.services | keys | .[]' "$file")
for service in $services; do
platform=$(yq e ".services.$service.platform" "$file")
image=$(yq e ".services.$service.image" "$file")
# Replace '/' and ':' with '-' in the platform string to make it suitable for a tag
platform_tag=$(echo "$platform" | tr '/:' '-')
# Append platform information to the image tag
new_image_tag="${image}-${platform_tag}"
$engine manifest create $image manifest_create_cmd+=" $new_image_tag"
done
echo Manifest Create cmd: $manifest_create_cmd
$manifest_create_cmd
#########################################
echo manifest push cmd: $engine manifest push $image
$engine manifest push $image
} }
pull(){ pull(){
@@ -188,4 +206,7 @@ if [ "$pull" = true ]; then
pull pull
elif [ "$build" = true ]; then elif [ "$build" = true ]; then
build build
elif [ "$push" = true ]; then
# echo push
push
fi fi