mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Split meta image creation (#67480)
This commit is contained in:
parent
aac4036c0c
commit
063872a0c0
104
.github/workflows/builder.yml
vendored
104
.github/workflows/builder.yml
vendored
@ -243,21 +243,28 @@ jobs:
|
|||||||
channel: beta
|
channel: beta
|
||||||
|
|
||||||
publish_container:
|
publish_container:
|
||||||
name: Publish meta container
|
name: Publish meta container for ${{ matrix.registry }}
|
||||||
if: github.repository_owner == 'home-assistant'
|
if: github.repository_owner == 'home-assistant'
|
||||||
needs: ["init", "build_base"]
|
needs: ["init", "build_base"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
registry:
|
||||||
|
- "ghcr.io/home-assistant"
|
||||||
|
- "homeassistant"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3.0.0
|
uses: actions/checkout@v3.0.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
|
if: matrix.registry == 'homeassistant'
|
||||||
uses: docker/login-action@v1.14.1
|
uses: docker/login-action@v1.14.1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
|
if: matrix.registry == 'ghcr.io/home-assistant'
|
||||||
uses: docker/login-action@v1.14.1
|
uses: docker/login-action@v1.14.1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@ -273,38 +280,37 @@ jobs:
|
|||||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
|
|
||||||
function create_manifest() {
|
function create_manifest() {
|
||||||
local docker_reg=${1}
|
local tag_l=${1}
|
||||||
local tag_l=${2}
|
local tag_r=${2}
|
||||||
local tag_r=${3}
|
|
||||||
|
|
||||||
docker manifest create "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest create "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/amd64-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/amd64-homeassistant:${tag_r}" \
|
||||||
"${docker_reg}/i386-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/i386-homeassistant:${tag_r}" \
|
||||||
"${docker_reg}/armhf-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/armhf-homeassistant:${tag_r}" \
|
||||||
"${docker_reg}/armv7-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/armv7-homeassistant:${tag_r}" \
|
||||||
"${docker_reg}/aarch64-homeassistant:${tag_r}"
|
"${{ matrix.registry }}/aarch64-homeassistant:${tag_r}"
|
||||||
|
|
||||||
docker manifest annotate "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest annotate "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/amd64-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/amd64-homeassistant:${tag_r}" \
|
||||||
--os linux --arch amd64
|
--os linux --arch amd64
|
||||||
|
|
||||||
docker manifest annotate "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest annotate "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/i386-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/i386-homeassistant:${tag_r}" \
|
||||||
--os linux --arch 386
|
--os linux --arch 386
|
||||||
|
|
||||||
docker manifest annotate "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest annotate "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/armhf-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/armhf-homeassistant:${tag_r}" \
|
||||||
--os linux --arch arm --variant=v6
|
--os linux --arch arm --variant=v6
|
||||||
|
|
||||||
docker manifest annotate "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest annotate "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/armv7-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/armv7-homeassistant:${tag_r}" \
|
||||||
--os linux --arch arm --variant=v7
|
--os linux --arch arm --variant=v7
|
||||||
|
|
||||||
docker manifest annotate "${docker_reg}/home-assistant:${tag_l}" \
|
docker manifest annotate "${{ matrix.registry }}/home-assistant:${tag_l}" \
|
||||||
"${docker_reg}/aarch64-homeassistant:${tag_r}" \
|
"${{ matrix.registry }}/aarch64-homeassistant:${tag_r}" \
|
||||||
--os linux --arch arm64 --variant=v8
|
--os linux --arch arm64 --variant=v8
|
||||||
|
|
||||||
docker manifest push --purge "${docker_reg}/home-assistant:${tag_l}"
|
docker manifest push --purge "${{ matrix.registry }}/home-assistant:${tag_l}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_image() {
|
function validate_image() {
|
||||||
@ -315,36 +321,34 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
for docker_reg in "homeassistant" "ghcr.io/home-assistant"; do
|
docker pull "${{ matrix.registry }}/amd64-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
docker pull "${docker_reg}/amd64-homeassistant:${{ needs.init.outputs.version }}"
|
docker pull "${{ matrix.registry }}/i386-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
docker pull "${docker_reg}/i386-homeassistant:${{ needs.init.outputs.version }}"
|
docker pull "${{ matrix.registry }}/armhf-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
docker pull "${docker_reg}/armhf-homeassistant:${{ needs.init.outputs.version }}"
|
docker pull "${{ matrix.registry }}/armv7-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
docker pull "${docker_reg}/armv7-homeassistant:${{ needs.init.outputs.version }}"
|
docker pull "${{ matrix.registry }}/aarch64-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
docker pull "${docker_reg}/aarch64-homeassistant:${{ needs.init.outputs.version }}"
|
|
||||||
|
|
||||||
validate_image "${docker_reg}/amd64-homeassistant:${{ needs.init.outputs.version }}"
|
validate_image "${{ matrix.registry }}/amd64-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
validate_image "${docker_reg}/i386-homeassistant:${{ needs.init.outputs.version }}"
|
validate_image "${{ matrix.registry }}/i386-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
validate_image "${docker_reg}/armhf-homeassistant:${{ needs.init.outputs.version }}"
|
validate_image "${{ matrix.registry }}/armhf-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
validate_image "${docker_reg}/armv7-homeassistant:${{ needs.init.outputs.version }}"
|
validate_image "${{ matrix.registry }}/armv7-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
validate_image "${docker_reg}/aarch64-homeassistant:${{ needs.init.outputs.version }}"
|
validate_image "${{ matrix.registry }}/aarch64-homeassistant:${{ needs.init.outputs.version }}"
|
||||||
|
|
||||||
# Create version tag
|
# Create version tag
|
||||||
create_manifest "${docker_reg}" "${{ needs.init.outputs.version }}" "${{ needs.init.outputs.version }}"
|
create_manifest "${{ needs.init.outputs.version }}" "${{ needs.init.outputs.version }}"
|
||||||
|
|
||||||
# Create general tags
|
# Create general tags
|
||||||
if [[ "${{ needs.init.outputs.version }}" =~ d ]]; then
|
if [[ "${{ needs.init.outputs.version }}" =~ d ]]; then
|
||||||
create_manifest "${docker_reg}" "dev" "${{ needs.init.outputs.version }}"
|
create_manifest"dev" "${{ needs.init.outputs.version }}"
|
||||||
elif [[ "${{ needs.init.outputs.version }}" =~ b ]]; then
|
elif [[ "${{ needs.init.outputs.version }}" =~ b ]]; then
|
||||||
create_manifest "${docker_reg}" "beta" "${{ needs.init.outputs.version }}"
|
create_manifest "beta" "${{ needs.init.outputs.version }}"
|
||||||
create_manifest "${docker_reg}" "rc" "${{ needs.init.outputs.version }}"
|
create_manifest "rc" "${{ needs.init.outputs.version }}"
|
||||||
else
|
else
|
||||||
create_manifest "${docker_reg}" "stable" "${{ needs.init.outputs.version }}"
|
create_manifest "stable" "${{ needs.init.outputs.version }}"
|
||||||
create_manifest "${docker_reg}" "latest" "${{ needs.init.outputs.version }}"
|
create_manifest "latest" "${{ needs.init.outputs.version }}"
|
||||||
create_manifest "${docker_reg}" "beta" "${{ needs.init.outputs.version }}"
|
create_manifest "beta" "${{ needs.init.outputs.version }}"
|
||||||
create_manifest "${docker_reg}" "rc" "${{ needs.init.outputs.version }}"
|
create_manifest "rc" "${{ needs.init.outputs.version }}"
|
||||||
|
|
||||||
# Create series version tag (e.g. 2021.6)
|
# Create series version tag (e.g. 2021.6)
|
||||||
v="${{ needs.init.outputs.version }}"
|
v="${{ needs.init.outputs.version }}"
|
||||||
create_manifest "${docker_reg}" "${v%.*}" "${{ needs.init.outputs.version }}"
|
create_manifest "${v%.*}" "${{ needs.init.outputs.version }}"
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user