diff --git a/.github/workflow_templates/deploy-channel.multi.yml b/.github/workflow_templates/deploy-channel.multi.yml index 79361cedf9..335874922d 100644 --- a/.github/workflow_templates/deploy-channel.multi.yml +++ b/.github/workflow_templates/deploy-channel.multi.yml @@ -199,6 +199,37 @@ Jobs for visual control allowed editions when approving deploy to environments. docker image push ${SOURCE_RELEASE_VERSION_IMAGE} {!{- end }!} + {!{ range $werfEnv := slice "CE" "EE" "FE" "BE" "SE" }!} + - name: Set release date label for release ({!{ $werfEnv }!}) + if: ${{ needs.detect_editions.outputs.DEPLOY_{!{ $werfEnv }!} == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: {!{ $werfEnv }!} + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + {!{- end }!} + {!{/* Add 'publish' step for each edition to repuplish semver tag images to channel tag: - Pull deckhouse images from dev registry. diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 0b1cbf5627..2031b07549 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -465,6 +465,148 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + - name: Set release date label for release (CE) + if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: CE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (EE) + if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: EE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (FE) + if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: FE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (BE) + if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: BE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (SE) + if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: SE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + + - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index 9daa7ca41d..56b66ac346 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -465,6 +465,148 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + - name: Set release date label for release (CE) + if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: CE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (EE) + if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: EE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (FE) + if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: FE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (BE) + if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: BE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (SE) + if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: SE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + + - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} diff --git a/.github/workflows/deploy-early-access.yml b/.github/workflows/deploy-early-access.yml index d65e225e32..0a4e6a8092 100644 --- a/.github/workflows/deploy-early-access.yml +++ b/.github/workflows/deploy-early-access.yml @@ -465,6 +465,148 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + - name: Set release date label for release (CE) + if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: CE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (EE) + if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: EE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (FE) + if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: FE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (BE) + if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: BE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (SE) + if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: SE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + + - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} diff --git a/.github/workflows/deploy-rock-solid.yml b/.github/workflows/deploy-rock-solid.yml index c7b040d25b..ba1dc3a694 100644 --- a/.github/workflows/deploy-rock-solid.yml +++ b/.github/workflows/deploy-rock-solid.yml @@ -465,6 +465,148 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + - name: Set release date label for release (CE) + if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: CE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (EE) + if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: EE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (FE) + if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: FE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (BE) + if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: BE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (SE) + if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: SE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + + - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index 315cc8a70c..ae1c616696 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -465,6 +465,148 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} + - name: Set release date label for release (CE) + if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: CE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (EE) + if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: EE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (FE) + if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: FE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (BE) + if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: BE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + - name: Set release date label for release (SE) + if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} + env: + DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} + CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} + WERF_ENV: SE + run: | + PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" + if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then + PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" + echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" + fi + + REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') + + SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; + 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} + + - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }}