test new build

This commit is contained in:
buanet
2024-11-24 23:42:12 +01:00
parent 567998b7c4
commit a66ffffed9

View File

@@ -71,8 +71,8 @@ jobs:
push: true push: true
platforms: linux/arm/v7 platforms: linux/arm/v7
tags: | tags: |
buanet/iobroker:latest-armv7, buanet/iobroker:${{ env.version }}-armv7,
ghcr.io/buanet/iobroker:latest-armv7, ghcr.io/buanet/iobroker:${{ env.version }}-armv7,
build-latest-arm64v8-for-buanet: build-latest-arm64v8-for-buanet:
name: Build latest armv64v8 image for buanet name: Build latest armv64v8 image for buanet
@@ -138,8 +138,8 @@ jobs:
push: true push: true
platforms: linux/arm64/v8 platforms: linux/arm64/v8
tags: | tags: |
buanet/iobroker:latest-arm64v8, buanet/iobroker:${{ env.version }}-arm64v8,
ghcr.io/buanet/iobroker:latest-arm64v8, ghcr.io/buanet/iobroker:${{ env.version }}-arm64v8,
build-latest-amd64-for-buanet: build-latest-amd64-for-buanet:
name: Build latest amd64 image for buanet name: Build latest amd64 image for buanet
@@ -202,10 +202,10 @@ jobs:
push: true push: true
platforms: linux/amd64 platforms: linux/amd64
tags: | tags: |
buanet/iobroker:latest-amd64, buanet/iobroker:${{ env.version }}-amd64,
ghcr.io/buanet/iobroker:latest-amd64, ghcr.io/buanet/iobroker:${{ env.version }}-amd64,
create_and_push_multiarch_image: create-multiarch-image-for-buanet:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build-latest-armv7-for-buanet, build-latest-arm64v8-for-buanet, build-latest-amd64-for-buanet] needs: [build-latest-armv7-for-buanet, build-latest-arm64v8-for-buanet, build-latest-amd64-for-buanet]
steps: steps:
@@ -255,73 +255,228 @@ jobs:
- name: Create and push multi-platform image - name: Create and push multi-platform image
run: | run: |
docker buildx imagetools create -t buanet/iobroker:test buanet/iobroker:latest-armv7 buanet/iobroker:latest-arm64v8 buanet/iobroker:latest-amd64 docker buildx imagetools create -t buanet/iobroker:latest buanet/iobroker:${{ env.version }}-armv7 buanet/iobroker:${{ env.version }}-arm64v8 buanet/iobroker:${{ env.version }}-amd64
docker buildx imagetools create -t ghcr.io/buanet/iobroker:test ghcr.io/buanet/iobroker:latest-armv7 ghcr.io/buanet/iobroker:latest-arm64v8 ghcr.io/buanet/iobroker:latest-amd64 docker buildx imagetools create -t ghcr.io/buanet/iobroker:latest ghcr.io/buanet/iobroker:${{ env.version }}-armv7 ghcr.io/buanet/iobroker:${{ env.version }}-arm64v8 ghcr.io/buanet/iobroker:${{ env.version }}-amd64
# docker buildx imagetools create -t buanet/iobroker:${{ env.majorversion }} buanet/iobroker:latest-armv7 buanet/iobroker:latest-arm64v8 buanet/iobroker:latest-amd64 docker buildx imagetools create -t buanet/iobroker:${{ env.majorversion }} buanet/iobroker:${{ env.version }}-armv7 buanet/iobroker:${{ env.version }}-arm64v8 buanet/iobroker:${{ env.version }}-amd64
# docker buildx imagetools create -t buanet/iobroker:${{ env.version }} buanet/iobroker:latest-armv7 buanet/iobroker:latest-arm64v8 buanet/iobroker:latest-amd64 docker buildx imagetools create -t ghcr.io/buanet/iobroker:${{ env.majorversion }} ghcr.io/buanet/iobroker:${{ env.version }}-armv7 ghcr.io/buanet/iobroker:${{ env.version }}-arm64v8 ghcr.io/buanet/iobroker:${{ env.version }}-amd64
docker buildx imagetools create -t buanet/iobroker:${{ env.version }} buanet/iobroker:${{ env.version }}-armv7 buanet/iobroker:${{ env.version }}-arm64v8 buanet/iobroker:${{ env.version }}-amd64
docker buildx imagetools create -t ghcr.io/buanet/iobroker:${{ env.version }} ghcr.io/buanet/iobroker:${{ env.version }}-armv7 ghcr.io/buanet/iobroker:${{ env.version }}-arm64v8 ghcr.io/buanet/iobroker:${{ env.version }}-amd64
# build-latest-for-iobroker: build-latest-armv7-for-iobroker:
# name: Build latest image for iobroker name: Build latest armv7 image for iobroker
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# - name: Fetch latest release tag - name: Fetch latest release tag
# run: | run: |
# LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')" LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
# echo "Latest release tag : $LATESTRELEASE" echo "Latest release tag : $LATESTRELEASE"
# echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
#
# - name: Checkout repo - name: Checkout repo
# uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
# with: with:
# repository: 'buanet/ioBroker.docker' repository: 'buanet/ioBroker.docker'
# ref: ${{ env.RELEASE_TAG }} ref: ${{ env.RELEASE_TAG }}
#
# - name: Set job variables - name: Set job variables
# run: | run: |
# VERSION="$(cat .VERSION)" VERSION="$(cat .VERSION)"
# MAJORVERSION="$(cat .VERSION | cut -c 1-3 | sed -r 's#^(.{0})#\1latest-#')" MAJORVERSION="$(cat .VERSION | cut -c 1-3 | sed -r 's#^(.{0})#\1latest-#')"
# DATI="$(date --rfc-3339=seconds | sed 's/ /T/')" DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
# # Log output and export as Github environment variable # Log output and export as Github environment variable
# echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}" echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
# echo "[LOG] Image Version: $VERSION" echo "[LOG] Image Version: $VERSION"
# echo "version=$VERSION" >> $GITHUB_ENV echo "version=$VERSION" >> $GITHUB_ENV
# echo "[LOG] Major Image Version: $MAJORVERSION" echo "[LOG] Major Image Version: $MAJORVERSION"
# echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
# echo "[LOG] Buildnumber/Timestamp: $DATI" echo "[LOG] Buildnumber/Timestamp: $DATI"
# echo "dati=$DATI" >> $GITHUB_ENV echo "dati=$DATI" >> $GITHUB_ENV
# # Set values in iobroker_startup.sh # Set values in iobroker_startup.sh
# sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
# mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
# # Set values in Dockerfile # Set values in Dockerfile
# sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
# mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
#
# - name: Set up QEMU - name: Set up QEMU
# uses: docker/setup-qemu-action@v3.2.0 uses: docker/setup-qemu-action@v3.2.0
#
# - name: Set up Docker Buildx - name: Set up Docker Buildx
# id: buildx id: buildx
# uses: docker/setup-buildx-action@v3.6.1 uses: docker/setup-buildx-action@v3.6.1
#
# - name: Login to DockerHub (buanet) - name: Login to DockerHub (iobroker)
# uses: docker/login-action@v3.3.0 uses: docker/login-action@v3.3.0
# with: with:
# username: ${{ secrets.DOCKER_USER_IOB }} username: ${{ secrets.DOCKER_USER_IOB }}
# password: ${{ secrets.DOCKER_PASS_IOB }} password: ${{ secrets.DOCKER_PASS_IOB }}
#
# - name: Build and push Docker image - name: Build and push Docker image
# uses: docker/build-push-action@v6.6.1 uses: docker/build-push-action@v6.6.1
# with: with:
# context: ./debian12 context: ./debian12
# file: ./debian12/Dockerfile file: ./debian12/Dockerfile
# push: false push: true
# platforms: | platforms: linux/arm/v7
# linux/amd64 tags: iobroker/iobroker:${{ env.version }}-armv7
# linux/arm64/v8
# linux/arm/v7 build-latest-arm64v8-for-iobroker:
# tags: | name: Build latest armv64v8 image for iobroker
# iobroker/iobroker:latest, runs-on: ubuntu-latest
# iobroker/iobroker:${{ env.majorversion }}, steps:
# iobroker/iobroker:${{ env.version }}, - name: Fetch latest release tag
# provenance: false run: |
# outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net) LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
echo "Latest release tag : $LATESTRELEASE"
echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
- name: Checkout repo
uses: actions/checkout@v4.1.7
with:
repository: 'buanet/ioBroker.docker'
ref: ${{ env.RELEASE_TAG }}
- name: Set job variables
run: |
VERSION="$(cat .VERSION)"
MAJORVERSION="$(cat .VERSION | cut -c 1-3 | sed -r 's#^(.{0})#\1latest-#')"
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
# Log output and export as Github environment variable
echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
echo "[LOG] Image Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
echo "[LOG] Major Image Version: $MAJORVERSION"
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
echo "[LOG] Buildnumber/Timestamp: $DATI"
echo "dati=$DATI" >> $GITHUB_ENV
# Set values in iobroker_startup.sh
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
# Set values in Dockerfile
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Login to DockerHub (iobroker)
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USER_IOB }}
password: ${{ secrets.DOCKER_PASS_IOB }}
- name: Build and push Docker image
uses: docker/build-push-action@v6.6.1
with:
context: ./debian12
file: ./debian12/Dockerfile
push: true
platforms: linux/arm64/v8
tags: iobroker/iobroker:${{ env.version }}-arm64v8
build-latest-amd64-for-iobroker:
name: Build latest amd64 image for iobroker
runs-on: ubuntu-latest
steps:
- name: Fetch latest release tag
run: |
LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
echo "Latest release tag : $LATESTRELEASE"
echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
- name: Checkout repo
uses: actions/checkout@v4.1.7
with:
repository: 'buanet/ioBroker.docker'
ref: ${{ env.RELEASE_TAG }}
- name: Set job variables
run: |
VERSION="$(cat .VERSION)"
MAJORVERSION="$(cat .VERSION | cut -c 1-3 | sed -r 's#^(.{0})#\1latest-#')"
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
# Log output and export as Github environment variable
echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
echo "[LOG] Image Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
echo "[LOG] Major Image Version: $MAJORVERSION"
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
echo "[LOG] Buildnumber/Timestamp: $DATI"
echo "dati=$DATI" >> $GITHUB_ENV
# Set values in iobroker_startup.sh
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
# Set values in Dockerfile
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Login to DockerHub (iobroker)
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USER_IOB }}
password: ${{ secrets.DOCKER_PASS_IOB }}
- name: Build and push Docker image
uses: docker/build-push-action@v6.6.1
with:
context: ./debian12
file: ./debian12/Dockerfile
push: true
platforms: linux/amd64
tags: iobroker/iobroker:${{ env.version }}-amd64
create-multiarch-image-for-iobroker:
runs-on: ubuntu-latest
needs: [build-latest-armv7-for-iobroker, build-latest-arm64v8-for-iobroker, build-latest-amd64-for-iobroker]
steps:
- name: Fetch latest release tag
run: |
LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
echo "Latest release tag : $LATESTRELEASE"
echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
- name: Checkout repo
uses: actions/checkout@v4.1.7
with:
repository: 'buanet/ioBroker.docker'
ref: ${{ env.RELEASE_TAG }}
- name: Set job variables
run: |
VERSION="$(cat .VERSION)"
MAJORVERSION="$(cat .VERSION | cut -c 1-3 | sed -r 's#^(.{0})#\1latest-#')"
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
# Log output and export as Github environment variable
echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
echo "[LOG] Image Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
echo "[LOG] Major Image Version: $MAJORVERSION"
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
echo "[LOG] Buildnumber/Timestamp: $DATI"
echo "dati=$DATI" >> $GITHUB_ENV
# Set values in iobroker_startup.sh
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
# Set values in Dockerfile
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
- name: Login to DockerHub (iobroker)
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USER_IOB }}
password: ${{ secrets.DOCKER_PASS_IOB }}
- name: Create and push multi-platform image
run: |
docker buildx imagetools create -t iobroker/iobroker:latest iobroker/iobroker:${{ env.version }}-armv7 iobroker/iobroker:${{ env.version }}-arm64v8 iobroker/iobroker:${{ env.version }}-amd64
docker buildx imagetools create -t iobroker/iobroker:${{ env.majorversion }} iobroker/iobroker:${{ env.version }}-armv7 iobroker/iobroker:${{ env.version }}-arm64v8 iobroker/iobroker:${{ env.version }}-amd64
docker buildx imagetools create -t iobroker/iobroker:${{ env.version }} iobroker/iobroker:${{ env.version }}-armv7 iobroker/iobroker:${{ env.version }}-arm64v8 iobroker/iobroker:${{ env.version }}-amd64