Skip to content

Commit

Permalink
🤖 Fix os-release
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Itxaka committed Oct 26, 2023
1 parent d163f3d commit c07f5ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions naming.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c07f5ef

Please sign in to comment.