diff --git a/.github/workflow_templates/deploy-channel.multi.yml b/.github/workflow_templates/deploy-channel.multi.yml index 335874922d..4b52e44db2 100644 --- a/.github/workflow_templates/deploy-channel.multi.yml +++ b/.github/workflow_templates/deploy-channel.multi.yml @@ -219,15 +219,19 @@ Jobs for visual control allowed editions when approving deploy to environments. SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; {!{- end }!} {!{/* diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 2031b07549..37ad78d35c 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -484,15 +484,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (EE) if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} env: @@ -512,15 +516,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (FE) if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} env: @@ -540,15 +548,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (BE) if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} env: @@ -568,15 +580,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (SE) if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} env: @@ -596,15 +612,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index 56b66ac346..1896bcb93d 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -484,15 +484,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (EE) if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} env: @@ -512,15 +516,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (FE) if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} env: @@ -540,15 +548,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (BE) if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} env: @@ -568,15 +580,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (SE) if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} env: @@ -596,15 +612,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; diff --git a/.github/workflows/deploy-early-access.yml b/.github/workflows/deploy-early-access.yml index 0a4e6a8092..181048e26d 100644 --- a/.github/workflows/deploy-early-access.yml +++ b/.github/workflows/deploy-early-access.yml @@ -484,15 +484,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (EE) if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} env: @@ -512,15 +516,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (FE) if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} env: @@ -540,15 +548,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (BE) if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} env: @@ -568,15 +580,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (SE) if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} env: @@ -596,15 +612,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; diff --git a/.github/workflows/deploy-rock-solid.yml b/.github/workflows/deploy-rock-solid.yml index ba1dc3a694..006d461df9 100644 --- a/.github/workflows/deploy-rock-solid.yml +++ b/.github/workflows/deploy-rock-solid.yml @@ -484,15 +484,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (EE) if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} env: @@ -512,15 +516,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (FE) if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} env: @@ -540,15 +548,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (BE) if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} env: @@ -568,15 +580,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (SE) if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} env: @@ -596,15 +612,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index ae1c616696..f077f12945 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -484,15 +484,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (EE) if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} env: @@ -512,15 +516,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (FE) if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} env: @@ -540,15 +548,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (BE) if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} env: @@ -568,15 +580,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi; - name: Set release date label for release (SE) if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} env: @@ -596,15 +612,19 @@ jobs: SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - echo "⚓️ 📤 [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "⚓️ 📤 [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then + echo "⚓️ 🏷 [$(date -u)] Add release date label to images." + echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - + echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - + echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - + + echo "⚓️ 📤 [$(date -u)] Push images with release date label." + docker image push ${SOURCE_IMAGE} + docker image push ${SOURCE_INSTALL_IMAGE} + docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + else + echo "⚓️ 🏷 [$(date -u)] Release date label already present. Skipping." + fi;