From c07f5ef1d8cf44bc63c261e46358de0d953ef8fb Mon Sep 17 00:00:00 2001 From: Itxaka Date: Thu, 26 Oct 2023 11:16:52 +0200 Subject: [PATCH] :robot: Fix os-release OS_REPO should be the repo, not repo+artifact OS_NAME should be kairos-${VARIANT}-${FLAVOR}-${FLAVOR_RELEASE} to provider a name like: kairos-core-alpine-3.18 or kairos-standard-ubuntu-20.04 Signed-off-by: Itxaka --- Earthfile | 7 +++++-- naming.sh | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 7c2420397..3263ff099 100644 --- a/Earthfile +++ b/Earthfile @@ -135,8 +135,11 @@ OSRELEASE: ARG --required KAIROS_VERSION COPY ./naming.sh . - ARG OS_REPO=$(./naming.sh container_artifact_name) - ARG OS_NAME=$(./naming.sh common_artifact_name) + + # quay.io/kairos/alpine or quay.io/kairos/ubuntu for example as this is just the repo + ARG OS_REPO=$(./naming.sh container_artifact_repo) + # kairos-core-alpine-3.18 or kairos-standard-ubuntu-20.04 for example + ARG OS_NAME=kairos-${VARIANT}-${FLAVOR}-${FLAVOR_RELEASE} ARG OS_VERSION=$KAIROS_VERSION ARG OS_LABEL=$KAIROS_VERSION diff --git a/naming.sh b/naming.sh index 7a82d6792..42ca76169 100755 --- a/naming.sh +++ b/naming.sh @@ -79,6 +79,22 @@ container_artifact_name() { echo "$REGISTRY_AND_ORG/$FLAVOR:$tag" } +# returns the repo name for the container artifact +# for example quay.io/kairos/opensuse or quake.io/kairos/alpine +container_artifact_repo() { + if [ -z "$FLAVOR" ]; then + echo 'FLAVOR must be defined' + exit 1 + fi + + if [ -z "$REGISTRY_AND_ORG" ]; then + echo 'REGISTRY_AND_ORG must be defined' + exit 1 + fi + + echo "$REGISTRY_AND_ORG/$FLAVOR" +} + if [ -n "$ARTIFACT_JSON" ]; then setEnvVarsFromJSON @@ -94,6 +110,9 @@ case "$1" in "common_artifact_name") common_artifact_name ;; + "container_artifact_repo") + container_artifact_repo + ;; *) echo "Function not found: $1" exit 1