chore(oci): Enhance OCI build
There were too many `${IMAGE_NAME,,}` to always do a lower case operation. I now export the variable in the first step.
This commit is contained in:
@@ -20,10 +20,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Extract version
|
- name: Extract version
|
||||||
run: |
|
run: |
|
||||||
|
# remove "releases/"
|
||||||
VERSION="${VERSION#releases/}"
|
VERSION="${VERSION#releases/}"
|
||||||
|
# set image name to lower case
|
||||||
|
IMAGE_NAME="${IMAGE_NAME,,}"
|
||||||
|
|
||||||
echo "Exporting variable VERSION=$VERSION"
|
echo "Exporting variable VERSION=$VERSION"
|
||||||
|
echo "Exporting variable IMAGE_NAME=$IMAGE_NAME"
|
||||||
|
|
||||||
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
|
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
|
||||||
|
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITEA_OUTPUT
|
||||||
|
|
||||||
echo "VERSION=$VERSION" >> $GITEA_ENV
|
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||||
|
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITEA_ENV
|
||||||
|
|
||||||
- name: Install Buildah
|
- name: Install Buildah
|
||||||
run: |-
|
run: |-
|
||||||
@@ -44,12 +53,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and tag
|
- name: Build and tag
|
||||||
run: |-
|
run: |-
|
||||||
echo "Building image $REGISTRY/${IMAGE_NAME,,}:$VERSION / latest"
|
echo "Building image ${REGISTRY}/${IMAGE_NAME}:${VERSION} / latest"
|
||||||
buildah build --isolation=chroot --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
buildah build --isolation=chroot --build-arg VERSION=${VERSION} -t katenary -f ./oci/katenary/Containerfile .
|
||||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
buildah tag katenary ${REGISTRY}/${IMAGE_NAME}:${VERSION}
|
||||||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
|
buildah tag katenary ${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |-
|
run: |-
|
||||||
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
buildah push ${REGISTRY}/${IMAGE_NAME}:${VERSION}
|
||||||
buildah push $REGISTRY/${IMAGE_NAME,,}:latest
|
buildah push ${REGISTRY}/${IMAGE_NAME}:latest
|
||||||
|
Reference in New Issue
Block a user